diff --git a/js/packages/dapp-account/DeleteAccount/deleteAccount.css b/js/packages/dapp-account/DeleteAccount/deleteAccount.css
deleted file mode 100644
index 5252e9454..000000000
--- a/js/packages/dapp-account/DeleteAccount/deleteAccount.css
+++ /dev/null
@@ -1,54 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.body {
- .hero {
- padding-bottom: 1em;
- }
-
- .info {
- display: inline-block;
- }
-
- .icon {
- display: inline-block;
- }
-
- .nameinfo {
- display: inline-block;
- text-align: left;
- }
-
- .header {
- text-transform: uppercase;
- font-size: 1.25em;
- padding-bottom: 0.25em;
- }
-
- .address {
- }
-
- .description {
- padding-top: 1em;
- font-size: 0.75em;
- color: #aaa;
- }
-
- .password {
- padding: 1em 5em;
- }
-}
diff --git a/js/packages/dapp-account/DeleteAccount/deleteAccount.js b/js/packages/dapp-account/DeleteAccount/deleteAccount.js
deleted file mode 100644
index 65c9c7c98..000000000
--- a/js/packages/dapp-account/DeleteAccount/deleteAccount.js
+++ /dev/null
@@ -1,156 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-import { connect } from 'react-redux';
-import { bindActionCreators } from 'redux';
-
-import { newError } from '@parity/shared/redux/actions';
-import { ConfirmDialog, IdentityIcon, IdentityName, Input } from '@parity/ui';
-
-import styles from './deleteAccount.css';
-
-class DeleteAccount extends Component {
- static contextTypes = {
- api: PropTypes.object.isRequired,
- router: PropTypes.object
- }
-
- static propTypes = {
- account: PropTypes.object.isRequired,
- onClose: PropTypes.func.isRequired,
- newError: PropTypes.func.isRequired
- }
-
- state = {
- isBusy: false,
- password: ''
- }
-
- render () {
- const { account } = this.props;
- const { isBusy, password } = this.state;
-
- return (
-
- }
- >
-
- );
- }
-
- renderSummaryRequest () {
- return (
-
- );
- }
-
- onClose = () => {
- this.props.onClose();
- }
-
- onExecute = () => {
- return this.store.makeItRain();
- }
-}
diff --git a/js/packages/dapp-account/Faucet/index.js b/js/packages/dapp-account/Faucet/index.js
deleted file mode 100644
index 9aaa695dc..000000000
--- a/js/packages/dapp-account/Faucet/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './faucet';
diff --git a/js/packages/dapp-account/Faucet/store.js b/js/packages/dapp-account/Faucet/store.js
deleted file mode 100644
index 18c226971..000000000
--- a/js/packages/dapp-account/Faucet/store.js
+++ /dev/null
@@ -1,127 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { action, computed, observable, transaction } from 'mobx';
-
-import apiutil from '@parity/api/util';
-
-const ENDPOINT = 'http://faucet.kovan.network/api/';
-
-export default class Store {
- @observable addressReceive = null;
- @observable addressVerified = null;
- @observable error = null;
- @observable responseText = null;
- @observable responseTxHash = null;
- @observable isBusy = false;
- @observable isCompleted = false;
- @observable isDestination = false;
- @observable isDone = false;
-
- constructor (netVersion, address) {
- transaction(() => {
- this.setDestination(netVersion === '42');
-
- this.setAddressReceive(address);
- this.setAddressVerified(address);
- });
- }
-
- @computed get canTransact () {
- return !this.isBusy && this.addressReceiveValid && this.addressVerifiedValid;
- }
-
- @computed get addressReceiveValid () {
- return apiutil.isAddressValid(this.addressReceive);
- }
-
- @computed get addressVerifiedValid () {
- return apiutil.isAddressValid(this.addressVerified);
- }
-
- @action setAddressReceive = (address) => {
- this.addressReceive = address;
- }
-
- @action setAddressVerified = (address) => {
- this.addressVerified = address;
- }
-
- @action setBusy = (isBusy) => {
- this.isBusy = isBusy;
- }
-
- @action setCompleted = (isCompleted) => {
- transaction(() => {
- this.setBusy(false);
- this.isCompleted = isCompleted;
- });
- }
-
- @action setDestination = (isDestination) => {
- this.isDestination = isDestination;
- }
-
- @action setError = (error) => {
- if (error.indexOf('not certified') !== -1) {
- this.error = `${error}. Please ensure that this account is sms certified on the mainnet.`;
- } else {
- this.error = error;
- }
- }
-
- @action setResponse = (response) => {
- this.responseText = response.result;
- this.responseTxHash = response.tx;
- }
-
- makeItRain = () => {
- this.setBusy(true);
-
- const options = {
- method: 'GET',
- mode: 'cors'
- };
- const url = `${ENDPOINT}${this.addressVerified}`;
-
- return fetch(url, options)
- .then((response) => {
- if (!response.ok) {
- return null;
- }
-
- return response.json();
- })
- .catch(() => {
- return null;
- })
- .then((response) => {
- transaction(() => {
- if (!response || response.error) {
- this.setError(
- response
- ? response.error
- : 'Unable to complete request to the faucet, the server may be unavailable. Please try again later.'
- );
- } else {
- this.setResponse(response);
- }
-
- this.setCompleted(true);
- });
- });
- }
-}
diff --git a/js/packages/dapp-account/Header/header.css b/js/packages/dapp-account/Header/header.css
deleted file mode 100644
index f894b7c49..000000000
--- a/js/packages/dapp-account/Header/header.css
+++ /dev/null
@@ -1,86 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.editicon {
- margin-left: 0.5em;
-}
-
-.info {
- margin: 0 156px 0 0;
-}
-
-.identityIcon {
- float: left;
- margin-right: -100%;
-}
-
-.qrcode {
- float: right;
- margin-top: 1.5em;
-}
-
-.addressline,
-.infoline,
-.uuidline,
-.vault,
-.title {
- margin-left: 72px;
-}
-
-.addressline,
-.infoline,
-.uuidline {
- line-height: 1.618em;
-
- &.bigaddress {
- font-size: 1.25em;
- }
-}
-
-.infoline,
-.uuidline {
- opacity: 0.25;
-}
-
-.uuidline {
- display: inline-block;
-}
-
-.vault {
- line-height: 32px;
-
- .text {
- display: inline-block;
- opacity: 0.25;
- text-transform: uppercase;
- }
-}
-
-.addressline {
- display: flex;
-}
-
-.address {
- display: inline-block;
- margin-left: 0.5em;
- overflow: hidden;
- text-overflow: ellipsis;
-}
-
-.tags {
- clear: both;
-}
diff --git a/js/packages/dapp-account/Header/header.js b/js/packages/dapp-account/Header/header.js
deleted file mode 100644
index d571be41c..000000000
--- a/js/packages/dapp-account/Header/header.js
+++ /dev/null
@@ -1,214 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-
-import { Balance, Certifications, Container, CopyToClipboard, ContainerTitle, IdentityIcon, IdentityName, QrCode, Tags, VaultTag } from '@parity/ui';
-
-import styles from './header.css';
-
-export default class Header extends Component {
- static contextTypes = {
- api: PropTypes.object.isRequired
- };
-
- static propTypes = {
- account: PropTypes.object,
- children: PropTypes.node,
- className: PropTypes.string,
- disabled: PropTypes.bool,
- hideName: PropTypes.bool,
- isContract: PropTypes.bool
- };
-
- static defaultProps = {
- children: null,
- className: '',
- hideName: false,
- isContract: false
- };
-
- state = {
- txCount: null
- };
-
- txCountSubId = null;
-
- componentWillMount () {
- if (this.props.account && !this.props.isContract) {
- this.subscribeTxCount();
- }
- }
-
- componentWillUnmount () {
- this.unsubscribeTxCount();
- }
-
- subscribeTxCount () {
- const { api } = this.context;
-
- api
- .subscribe('eth_blockNumber', (error) => {
- if (error) {
- return console.error(error);
- }
-
- api.eth.getTransactionCount(this.props.account.address)
- .then((txCount) => this.setState({ txCount }));
- })
- .then((subscriptionId) => {
- this.txCountSubId = subscriptionId;
- });
- }
-
- unsubscribeTxCount () {
- if (!this.txCountSubId) {
- return;
- }
-
- this.context.api.unsubscribe(this.txCountSubId);
- }
-
- render () {
- const { account, children, className, disabled, hideName } = this.props;
-
- if (!account) {
- return null;
- }
-
- const { address } = account;
- const meta = account.meta || {};
-
- return (
-
- );
- }
-
- renderVault () {
- const { account } = this.props;
- const { meta } = account;
-
- if (!meta || !meta.vault) {
- return null;
- }
-
- return (
-
- );
- }
-}
diff --git a/js/packages/dapp-account/Header/header.spec.js b/js/packages/dapp-account/Header/header.spec.js
deleted file mode 100644
index d761807b4..000000000
--- a/js/packages/dapp-account/Header/header.spec.js
+++ /dev/null
@@ -1,247 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import BigNumber from 'bignumber.js';
-import { shallow } from 'enzyme';
-import React from 'react';
-
-import { ETH_TOKEN } from '@parity/shared/util/tokens';
-
-import Header from './';
-
-const ACCOUNT = {
- address: '0x0123456789012345678901234567890123456789',
- meta: {
- description: 'the description',
- tags: ['taga', 'tagb']
- },
- uuid: '0xabcdef'
-};
-const subscriptions = {};
-
-let component;
-let instance;
-
-const api = {
- subscribe: (method, callback) => {
- subscriptions[method] = (subscriptions[method] || []).concat(callback);
- return Promise.resolve(0);
- },
- eth: {
- getTransactionCount: () => Promise.resolve(new BigNumber(1))
- }
-};
-
-function reduxStore () {
- const getState = () => ({
- balances: {},
- tokens: {
- [ETH_TOKEN.id]: ETH_TOKEN
- }
- });
-
- return {
- getState,
- dispatch: () => null,
- subscribe: () => null
- };
-}
-
-function render (props = {}) {
- if (props && !props.account) {
- props.account = ACCOUNT;
- }
-
- component = shallow(
- ,
- { context: { api } }
- );
- instance = component.instance();
-
- return component;
-}
-
-describe('views/Account/Header', () => {
- describe('rendering', () => {
- it('renders defaults', () => {
- expect(render()).to.be.ok;
- });
-
- it('renders null with no account', () => {
- expect(render(null).find('div')).to.have.length(0);
- });
-
- it('renders when no account meta', () => {
- expect(render({ account: { address: ACCOUNT.address } })).to.be.ok;
- });
-
- it('renders when no account description', () => {
- expect(render({ account: { address: ACCOUNT.address, meta: { tags: [] } } })).to.be.ok;
- });
-
- it('renders when no account tags', () => {
- expect(render({ account: { address: ACCOUNT.address, meta: { description: 'something' } } })).to.be.ok;
- });
-
- describe('sections', () => {
- describe('Balance', () => {
- let balance;
-
- beforeEach(() => {
- render();
- balance = component.find('Connect(Balance)')
- .shallow({ context: { store: reduxStore() } });
- });
-
- it('renders', () => {
- expect(balance).to.have.length(1);
- });
-
- it('passes the account', () => {
- expect(balance.props().address).to.deep.equal(ACCOUNT.address);
- });
- });
-
- describe('Certifications', () => {
- let certs;
-
- beforeEach(() => {
- render();
- certs = component.find('Connect(Certifications)');
- });
-
- it('renders', () => {
- expect(certs).to.have.length(1);
- });
-
- it('passes the address', () => {
- expect(certs.props().address).to.deep.equal(ACCOUNT.address);
- });
- });
-
- describe('IdentityIcon', () => {
- let icon;
-
- beforeEach(() => {
- render();
- icon = component.find('IdentityIcon');
- });
-
- it('renders', () => {
- expect(icon).to.have.length(1);
- });
-
- it('passes the address', () => {
- expect(icon.props().address).to.deep.equal(ACCOUNT.address);
- });
- });
-
- describe('QrCode', () => {
- let qr;
-
- beforeEach(() => {
- render();
- qr = component.find('QrCode');
- });
-
- it('renders', () => {
- expect(qr).to.have.length(1);
- });
-
- it('passes the address', () => {
- expect(qr.props().value).to.deep.equal(ACCOUNT.address);
- });
- });
-
- describe('Tags', () => {
- let tags;
-
- beforeEach(() => {
- render();
- tags = component.find('Tags');
- });
-
- it('renders', () => {
- expect(tags).to.have.length(1);
- });
-
- it('passes the tags', () => {
- expect(tags.props().tags).to.deep.equal(ACCOUNT.meta.tags);
- });
- });
- });
- });
-
- describe('renderName', () => {
- it('renders null with hideName', () => {
- render({ hideName: true });
- expect(instance.renderName()).to.be.null;
- });
-
- it('renders the name', () => {
- render();
- expect(instance.renderName()).not.to.be.null;
- });
-
- it('renders when no address specified', () => {
- render({ account: {} });
- expect(instance.renderName()).to.be.ok;
- });
- });
-
- describe('renderTxCount', () => {
- it('renders null when txCount is null', () => {
- render();
- expect(instance.renderTxCount()).to.be.null;
- });
-
- it('renders null when contract', () => {
- render({ isContract: true });
-
- subscriptions['eth_blockNumber'].forEach((callback) => {
- callback();
-
- setTimeout(() => {
- expect(instance.renderTxCount()).to.be.null;
- });
- });
- });
-
- it('renders the tx count', () => {
- render();
-
- subscriptions['eth_blockNumber'].forEach((callback) => {
- callback();
-
- setTimeout(() => {
- expect(instance.renderTxCount()).not.to.be.null;
- });
- });
- });
- });
-
- describe('renderUuid', () => {
- it('renders null with no uuid', () => {
- render({ account: Object.assign({}, ACCOUNT, { uuid: null }) });
- expect(instance.renderUuid()).to.be.null;
- });
-
- it('renders the uuid', () => {
- render();
- expect(instance.renderUuid()).not.to.be.null;
- });
- });
-});
diff --git a/js/packages/dapp-account/Header/index.js b/js/packages/dapp-account/Header/index.js
deleted file mode 100644
index aef90266f..000000000
--- a/js/packages/dapp-account/Header/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './header';
diff --git a/js/packages/dapp-account/PasswordManager/index.js b/js/packages/dapp-account/PasswordManager/index.js
deleted file mode 100644
index 3ecddbc57..000000000
--- a/js/packages/dapp-account/PasswordManager/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './passwordManager.js';
diff --git a/js/packages/dapp-account/PasswordManager/passwordManager.css b/js/packages/dapp-account/PasswordManager/passwordManager.css
deleted file mode 100644
index 61f4cb4b1..000000000
--- a/js/packages/dapp-account/PasswordManager/passwordManager.css
+++ /dev/null
@@ -1,86 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.accountContainer {
- display: flex;
- flex-direction: row;
- margin-bottom: 1.5rem;
-}
-
-.accountInfos {
- display: flex;
- flex-direction: column;
- justify-content: space-around;
-}
-
-.accountInfos > * {
- margin: 0.25rem 0;
-}
-
-.hintLabel {
- text-transform: uppercase;
- font-size: 0.7rem;
- margin-right: 0.5rem;
-}
-
-.accountAddress {
- font-family: monospace;
- font-size: 0.9rem;
-}
-
-.accountName {
- font-size: 1.1rem;
-}
-
-.passwords {
- display: flex;
- flex-wrap: wrap;
-}
-
-.password {
- flex: 0 1 50%;
- width: 50%;
-}
-
-.passwordHint {
- font-size: 0.9rem;
- color: lightgrey;
-}
-
-.message {
- border: 1px solid #ddd;
- margin-top: 1rem;
- width: 100%;
- height: 2.5rem;
- text-align: center;
- line-height: 2.5rem;
- transition: height 350ms 0;
- overflow: hidden;
- z-index: 1;
-}
-
-.hideMessage {
- height: 0;
- background-color: transparent !important;
-}
-
-.form {
- box-sizing: border-box;
- margin-top: 0;
- padding: 0.75rem 1.5rem 1.5rem;
- background-color: rgba(255, 255, 255, 0.05);
-}
diff --git a/js/packages/dapp-account/PasswordManager/passwordManager.js b/js/packages/dapp-account/PasswordManager/passwordManager.js
deleted file mode 100644
index e17d1ec9f..000000000
--- a/js/packages/dapp-account/PasswordManager/passwordManager.js
+++ /dev/null
@@ -1,424 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { observer } from 'mobx-react';
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-import { connect } from 'react-redux';
-import { bindActionCreators } from 'redux';
-
-import { newError, openSnackbar } from '@parity/shared/redux/actions';
-import { Button, IdentityName, IdentityIcon, Portal, Tabs } from '@parity/ui';
-import PasswordStrength from '@parity/ui/Form/PasswordStrength';
-import Form, { Input } from '@parity/ui/Form';
-import { CancelIcon, CheckIcon, SendIcon } from '@parity/ui/Icons';
-
-import Store from './store';
-import styles from './passwordManager.css';
-
-const MSG_SUCCESS_STYLE = {
- backgroundColor: 'rgba(174, 213, 129, 0.75)'
-};
-const MSG_FAILURE_STYLE = {
- backgroundColor: 'rgba(229, 115, 115, 0.75)'
-};
-
-@observer
-class PasswordManager extends Component {
- static contextTypes = {
- api: PropTypes.object.isRequired
- }
-
- static propTypes = {
- account: PropTypes.object.isRequired,
- openSnackbar: PropTypes.func.isRequired,
- newError: PropTypes.func.isRequired,
- onClose: PropTypes.func
- }
-
- store = new Store(this.context.api, this.props.account);
-
- render () {
- const { busy } = this.store;
-
- return (
-
- }
- >
- { this.renderAccount() }
- { this.renderPage() }
- { this.renderMessage() }
-
- );
- }
-
- renderMessage () {
- const { infoMessage } = this.store;
-
- if (!infoMessage) {
- return null;
- }
-
- return (
-
- );
- }
-}
diff --git a/js/packages/dapp-account/Shapeshift/AwaitingDepositStep/awaitingDepositStep.spec.js b/js/packages/dapp-account/Shapeshift/AwaitingDepositStep/awaitingDepositStep.spec.js
deleted file mode 100644
index 58fc41664..000000000
--- a/js/packages/dapp-account/Shapeshift/AwaitingDepositStep/awaitingDepositStep.spec.js
+++ /dev/null
@@ -1,112 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { shallow } from 'enzyme';
-import React from 'react';
-
-import AwaitingDepositStep from './';
-
-const TEST_ADDRESS = '0x123456789123456789123456789123456789';
-
-let component;
-let instance;
-
-function render () {
- component = shallow(
-
- );
- instance = component.instance();
-
- return component;
-}
-
-describe('views/Account/Shapeshift/AwaitingDepositStep', () => {
- it('renders defaults', () => {
- expect(render()).to.be.ok;
- });
-
- it('displays waiting for address with empty depositAddress', () => {
- render();
- expect(component.find('FormattedMessage').props().id).to.match(/awaitingConfirmation/);
- });
-
- it('displays waiting for deposit with non-empty depositAddress', () => {
- render({ depositAddress: 'xyz' });
- expect(component.find('FormattedMessage').first().props().id).to.match(/awaitingDeposit/);
- });
-
- describe('instance methods', () => {
- describe('renderAddress', () => {
- let address;
-
- beforeEach(() => {
- address = shallow(instance.renderAddress(TEST_ADDRESS));
- });
-
- it('renders the address', () => {
- expect(address.text()).to.contain(TEST_ADDRESS);
- });
-
- describe('CopyToClipboard', () => {
- let copy;
-
- beforeEach(() => {
- copy = address.find('Connect(CopyToClipboard)');
- });
-
- it('renders the copy', () => {
- expect(copy.length).to.equal(1);
- });
-
- it('passes the address', () => {
- expect(copy.props().data).to.equal(TEST_ADDRESS);
- });
- });
-
- describe('QrCode', () => {
- let qr;
-
- beforeEach(() => {
- qr = address.find('QrCode');
- });
-
- it('renders the QrCode', () => {
- expect(qr.length).to.equal(1);
- });
-
- it('passed the address', () => {
- expect(qr.props().value).to.equal(TEST_ADDRESS);
- });
-
- describe('protocol link', () => {
- it('does not render a protocol link (unlinked type)', () => {
- expect(address.find('a')).to.have.length(0);
- });
-
- it('renders protocol link for BTC', () => {
- address = shallow(instance.renderAddress(TEST_ADDRESS, 'BTC'));
- expect(address.find('a').props().href).to.equal(`bitcoin:${TEST_ADDRESS}`);
- });
- });
- });
- });
- });
-});
diff --git a/js/packages/dapp-account/Shapeshift/AwaitingDepositStep/index.js b/js/packages/dapp-account/Shapeshift/AwaitingDepositStep/index.js
deleted file mode 100644
index a814af712..000000000
--- a/js/packages/dapp-account/Shapeshift/AwaitingDepositStep/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './awaitingDepositStep';
diff --git a/js/packages/dapp-account/Shapeshift/AwaitingExchangeStep/awaitingExchangeStep.js b/js/packages/dapp-account/Shapeshift/AwaitingExchangeStep/awaitingExchangeStep.js
deleted file mode 100644
index 67fdd77b3..000000000
--- a/js/packages/dapp-account/Shapeshift/AwaitingExchangeStep/awaitingExchangeStep.js
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-import { observer } from 'mobx-react';
-
-import Value from '../Value';
-import styles from '../shapeshift.css';
-
-@observer
-export default class AwaitingExchangeStep extends Component {
- static propTypes = {
- store: PropTypes.object.isRequired
- }
-
- render () {
- const { depositInfo } = this.props.store;
- const { incomingCoin, incomingType } = depositInfo;
-
- return (
-
-
- ShapeShift.io
- } }
- />
-
-
-
-
-
-
-
-
- );
- }
-}
diff --git a/js/packages/dapp-account/Shapeshift/AwaitingExchangeStep/awaitingExchangeStep.spec.js b/js/packages/dapp-account/Shapeshift/AwaitingExchangeStep/awaitingExchangeStep.spec.js
deleted file mode 100644
index 253660e46..000000000
--- a/js/packages/dapp-account/Shapeshift/AwaitingExchangeStep/awaitingExchangeStep.spec.js
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { shallow } from 'enzyme';
-import React from 'react';
-
-import AwaitingExchangeStep from './';
-
-let component;
-
-function render () {
- component = shallow(
-
- );
-
- return component;
-}
-
-describe('views/Account/Shapeshift/AwaitingExchangeStep', () => {
- it('renders defaults', () => {
- expect(render()).to.be.ok;
- });
-});
diff --git a/js/packages/dapp-account/Shapeshift/AwaitingExchangeStep/index.js b/js/packages/dapp-account/Shapeshift/AwaitingExchangeStep/index.js
deleted file mode 100644
index d8d93b174..000000000
--- a/js/packages/dapp-account/Shapeshift/AwaitingExchangeStep/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './awaitingExchangeStep';
diff --git a/js/packages/dapp-account/Shapeshift/CompletedStep/completedStep.js b/js/packages/dapp-account/Shapeshift/CompletedStep/completedStep.js
deleted file mode 100644
index 135fd4abb..000000000
--- a/js/packages/dapp-account/Shapeshift/CompletedStep/completedStep.js
+++ /dev/null
@@ -1,59 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { observer } from 'mobx-react';
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-
-import Value from '../Value';
-import styles from '../shapeshift.css';
-
-@observer
-export default class CompletedStep extends Component {
- static propTypes = {
- store: PropTypes.object.isRequired
- }
-
- render () {
- const { depositInfo, exchangeInfo } = this.props.store;
- const { incomingCoin, incomingType } = depositInfo;
- const { outgoingCoin, outgoingType } = exchangeInfo;
-
- return (
-
-
- ShapeShift.io
- } }
- />
-
-
- =>
-
-
-
-
-
- );
- }
-}
diff --git a/js/packages/dapp-account/Shapeshift/CompletedStep/completedStep.spec.js b/js/packages/dapp-account/Shapeshift/CompletedStep/completedStep.spec.js
deleted file mode 100644
index 51b553a8e..000000000
--- a/js/packages/dapp-account/Shapeshift/CompletedStep/completedStep.spec.js
+++ /dev/null
@@ -1,41 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { shallow } from 'enzyme';
-import React from 'react';
-
-import CompletedStep from './';
-
-let component;
-
-function render () {
- component = shallow(
-
- );
-
- return component;
-}
-
-describe('views/Account/Shapeshift/CompletedStep', () => {
- it('renders defaults', () => {
- expect(render()).to.be.ok;
- });
-});
diff --git a/js/packages/dapp-account/Shapeshift/CompletedStep/index.js b/js/packages/dapp-account/Shapeshift/CompletedStep/index.js
deleted file mode 100644
index 26668d842..000000000
--- a/js/packages/dapp-account/Shapeshift/CompletedStep/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './completedStep';
diff --git a/js/packages/dapp-account/Shapeshift/ErrorStep/errorStep.js b/js/packages/dapp-account/Shapeshift/ErrorStep/errorStep.js
deleted file mode 100644
index d8e5ad72e..000000000
--- a/js/packages/dapp-account/Shapeshift/ErrorStep/errorStep.js
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { observer } from 'mobx-react';
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-
-import styles from '../shapeshift.css';
-
-@observer
-export default class ErrorStep extends Component {
- static propTypes = {
- store: PropTypes.object.isRequired
- }
-
- render () {
- const { error } = this.props.store;
-
- return (
-
-
- ShapeShift.io
- } }
- />
-
-
- { error.message }
-
-
- );
- }
-}
diff --git a/js/packages/dapp-account/Shapeshift/ErrorStep/errorStep.spec.js b/js/packages/dapp-account/Shapeshift/ErrorStep/errorStep.spec.js
deleted file mode 100644
index 515eaf1a0..000000000
--- a/js/packages/dapp-account/Shapeshift/ErrorStep/errorStep.spec.js
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { shallow } from 'enzyme';
-import React from 'react';
-
-import ErrorStep from './';
-
-let component;
-
-function render () {
- component = shallow(
-
- );
-
- return component;
-}
-
-describe('views/Account/Shapeshift/ErrorStep', () => {
- it('renders defaults', () => {
- expect(render()).to.be.ok;
- });
-});
diff --git a/js/packages/dapp-account/Shapeshift/ErrorStep/index.js b/js/packages/dapp-account/Shapeshift/ErrorStep/index.js
deleted file mode 100644
index c7bff0fed..000000000
--- a/js/packages/dapp-account/Shapeshift/ErrorStep/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './errorStep';
diff --git a/js/packages/dapp-account/Shapeshift/OptionsStep/index.js b/js/packages/dapp-account/Shapeshift/OptionsStep/index.js
deleted file mode 100644
index 57d752225..000000000
--- a/js/packages/dapp-account/Shapeshift/OptionsStep/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './optionsStep';
diff --git a/js/packages/dapp-account/Shapeshift/OptionsStep/optionsStep.css b/js/packages/dapp-account/Shapeshift/OptionsStep/optionsStep.css
deleted file mode 100644
index 026615537..000000000
--- a/js/packages/dapp-account/Shapeshift/OptionsStep/optionsStep.css
+++ /dev/null
@@ -1,61 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-.body {
-}
-
-.accept {
- margin: 1.5em 0;
-}
-
-.coinselector {
-}
-
-.coinselector .coinselect {
- margin-top: 11px;
-}
-
-.coinselect {
- max-height: 36px;
- padding: 4px 0 0 0;
- line-height: 32px;
-}
-
-.coinimage {
- display: inline-block;
- width: 32px;
- height: 32px;
- margin-right: 0.5em;
-}
-
-.coindetails {
- display: inline-block;
- vertical-align: top;
-}
-
-.coinsymbol {
- display: inline-block;
- margin-right: 0.5em;
- color: #aaa;
-}
-
-.coinname {
- display: inline-block;
-}
-
-.empty {
- color: #aaa;
-}
diff --git a/js/packages/dapp-account/Shapeshift/OptionsStep/optionsStep.js b/js/packages/dapp-account/Shapeshift/OptionsStep/optionsStep.js
deleted file mode 100644
index 0f52f81d2..000000000
--- a/js/packages/dapp-account/Shapeshift/OptionsStep/optionsStep.js
+++ /dev/null
@@ -1,140 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { observer } from 'mobx-react';
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-
-import { Checkbox, Dropdown, Form, Input, Warning } from '@parity/ui';
-
-import Price from '../Price';
-import { WARNING_NO_PRICE } from '../store';
-import styles from './optionsStep.css';
-
-const WARNING_LABELS = {
- [WARNING_NO_PRICE]: (
-
- )
-};
-
-@observer
-export default class OptionsStep extends Component {
- static propTypes = {
- store: PropTypes.object.isRequired
- };
-
- render () {
- const { coinSymbol, hasAcceptedTerms, price, refundAddress, warning } = this.props.store;
- let { coins } = this.props.store;
-
- if (!coins.length) {
- return (
-
- );
- }
-
- renderCoinSelectItem = (coin) => {
- const { image, name, symbol } = coin;
-
- return {
- image,
- text: name,
- value: symbol
- };
- }
-
- onChangeRefundAddress = (event, refundAddress) => {
- this.props.store.setRefundAddress(refundAddress);
- }
-
- onSelectCoin = (event, value) => {
- this.props.store.setCoinSymbol(value);
- }
-
- onToggleAcceptTerms = () => {
- this.props.store.toggleAcceptTerms();
- }
-}
diff --git a/js/packages/dapp-account/Shapeshift/OptionsStep/optionsSteps.spec.js b/js/packages/dapp-account/Shapeshift/OptionsStep/optionsSteps.spec.js
deleted file mode 100644
index e8d7639e0..000000000
--- a/js/packages/dapp-account/Shapeshift/OptionsStep/optionsSteps.spec.js
+++ /dev/null
@@ -1,126 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { shallow } from 'enzyme';
-import React from 'react';
-import sinon from 'sinon';
-
-import Store, { WARNING_NO_PRICE } from '../store';
-
-import OptionsStep from './';
-
-const ADDRESS = '0x1234567890123456789012345678901234567890';
-
-let component;
-let instance;
-let store;
-
-function render () {
- store = new Store(ADDRESS);
- component = shallow(
-
- );
- instance = component.instance();
-
- return component;
-}
-
-describe('views/Account/Shapeshift/OptionsStep', () => {
- beforeEach(() => {
- render();
- });
-
- it('renders defaults', () => {
- expect(component).to.be.ok;
- });
-
- it('renders no coins when none available', () => {
- expect(component.find('FormattedMessage').props().id).to.equal('shapeshift.optionsStep.noPairs');
- });
-
- describe('components', () => {
- beforeEach(() => {
- store.setCoins([{ symbol: 'BTC', name: 'Bitcoin' }]);
- store.toggleAcceptTerms();
- });
-
- describe('terms Checkbox', () => {
- it('shows the state of store.hasAcceptedTerms', () => {
- expect(component.find('Checkbox').props().checked).to.be.true;
- });
- });
-
- describe('warning', () => {
- let warning;
-
- beforeEach(() => {
- store.setWarning(WARNING_NO_PRICE);
- warning = component.find('Warning');
- });
-
- it('shows a warning message when available', () => {
- expect(warning.props().warning.props.id).to.equal('shapeshift.warning.noPrice');
- });
- });
- });
-
- describe('events', () => {
- describe('onChangeRefundAddress', () => {
- beforeEach(() => {
- sinon.stub(store, 'setRefundAddress');
- });
-
- afterEach(() => {
- store.setRefundAddress.restore();
- });
-
- it('sets the refundAddress on the store', () => {
- instance.onChangeRefundAddress(null, 'refundAddress');
- expect(store.setRefundAddress).to.have.been.calledWith('refundAddress');
- });
- });
-
- describe('onSelectCoin', () => {
- beforeEach(() => {
- sinon.stub(store, 'setCoinSymbol');
- });
-
- afterEach(() => {
- store.setCoinSymbol.restore();
- });
-
- it('sets the coinSymbol on the store', () => {
- instance.onSelectCoin(null, 'XMR');
- expect(store.setCoinSymbol).to.have.been.calledWith('XMR');
- });
- });
-
- describe('onToggleAcceptTerms', () => {
- beforeEach(() => {
- sinon.stub(store, 'toggleAcceptTerms');
- });
-
- afterEach(() => {
- store.toggleAcceptTerms.restore();
- });
-
- it('toggles the terms on the store', () => {
- instance.onToggleAcceptTerms();
- expect(store.toggleAcceptTerms).to.have.been.called;
- });
- });
- });
-});
diff --git a/js/packages/dapp-account/Shapeshift/Price/index.js b/js/packages/dapp-account/Shapeshift/Price/index.js
deleted file mode 100644
index 870689e03..000000000
--- a/js/packages/dapp-account/Shapeshift/Price/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './price';
diff --git a/js/packages/dapp-account/Shapeshift/Price/price.js b/js/packages/dapp-account/Shapeshift/Price/price.js
deleted file mode 100644
index 672c2d11b..000000000
--- a/js/packages/dapp-account/Shapeshift/Price/price.js
+++ /dev/null
@@ -1,59 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-
-import Value from '../Value';
-import styles from '../shapeshift.css';
-
-export default class Price extends Component {
- static propTypes = {
- coinSymbol: PropTypes.string.isRequired,
- price: PropTypes.shape({
- rate: PropTypes.number.isRequired,
- minimum: PropTypes.number.isRequired,
- limit: PropTypes.number.isRequired
- })
- }
-
- render () {
- const { coinSymbol, price } = this.props;
-
- if (!price) {
- return null;
- }
-
- return (
-
-
- =
-
-
- ,
- minimum:
- } }
- />
-
-
- );
- }
-}
diff --git a/js/packages/dapp-account/Shapeshift/Price/price.spec.js b/js/packages/dapp-account/Shapeshift/Price/price.spec.js
deleted file mode 100644
index 98ffa351f..000000000
--- a/js/packages/dapp-account/Shapeshift/Price/price.spec.js
+++ /dev/null
@@ -1,41 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { shallow } from 'enzyme';
-import React from 'react';
-
-import Price from './';
-
-let component;
-
-function render (props = {}) {
- component = shallow(
-
- );
-
- return component;
-}
-
-describe('views/Account/Shapeshift/Price', () => {
- it('renders defaults', () => {
- expect(render()).to.be.ok;
- });
-});
diff --git a/js/packages/dapp-account/Shapeshift/Value/index.js b/js/packages/dapp-account/Shapeshift/Value/index.js
deleted file mode 100644
index 9e981f7bf..000000000
--- a/js/packages/dapp-account/Shapeshift/Value/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './value';
diff --git a/js/packages/dapp-account/Shapeshift/Value/value.css b/js/packages/dapp-account/Shapeshift/Value/value.css
deleted file mode 100644
index 267287c70..000000000
--- a/js/packages/dapp-account/Shapeshift/Value/value.css
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-.body {
- display: inline-block;
- color: #aaa;
-}
-
-.amount {
- display: inline-block;
-}
-
-.symbol {
- font-variant: small-caps;
- margin-left: 0.1rem;
- font-size: 0.8em;
-}
diff --git a/js/packages/dapp-account/Shapeshift/Value/value.js b/js/packages/dapp-account/Shapeshift/Value/value.js
deleted file mode 100644
index d1d48eea3..000000000
--- a/js/packages/dapp-account/Shapeshift/Value/value.js
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import BigNumber from 'bignumber.js';
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-
-import styles from './value.css';
-
-export default class Value extends Component {
- static propTypes = {
- amount: PropTypes.oneOfType([
- PropTypes.number,
- PropTypes.string
- ]),
- symbol: PropTypes.string
- }
-
- render () {
- const { amount, symbol } = this.props;
-
- let value = '';
-
- if (amount) {
- value = new BigNumber(amount).toFormat(3);
- }
-
- return (
-
- { value }
- { symbol || 'ETH' }
-
- );
- }
-}
diff --git a/js/packages/dapp-account/Shapeshift/Value/value.spec.js b/js/packages/dapp-account/Shapeshift/Value/value.spec.js
deleted file mode 100644
index 950dc3fb8..000000000
--- a/js/packages/dapp-account/Shapeshift/Value/value.spec.js
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { shallow } from 'enzyme';
-import React from 'react';
-
-import Value from './';
-
-let component;
-
-function render (props = {}) {
- component = shallow(
-
- );
-
- return component;
-}
-
-describe('views/Account/Shapeshift/Value', () => {
- it('renders defaults', () => {
- expect(render()).to.be.ok;
- });
-});
diff --git a/js/packages/dapp-account/Shapeshift/index.js b/js/packages/dapp-account/Shapeshift/index.js
deleted file mode 100644
index 5bf7051eb..000000000
--- a/js/packages/dapp-account/Shapeshift/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './shapeshift';
diff --git a/js/packages/dapp-account/Shapeshift/shapeshift.css b/js/packages/dapp-account/Shapeshift/shapeshift.css
deleted file mode 100644
index 1982011f9..000000000
--- a/js/packages/dapp-account/Shapeshift/shapeshift.css
+++ /dev/null
@@ -1,84 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.body {
-}
-
-.addressInfo {
- text-align: center;
-
- .address {
- background: rgba(255, 255, 255, 0.1);
- margin: 0.75em 0;
- padding: 1em;
-
- span {
- margin-left: 0.75em;
- }
- }
-
- .qrcode {
- margin: 0.75em 0;
- }
-}
-
-.shapeshift {
- cursor: pointer;
- left: 1.5em;
- outline: none;
- position: absolute;
-
- img {
- height: 28px;
- }
-}
-
-.info, .busy {
-}
-
-.center {
- div {
- text-align: center;
- }
-}
-
-.error {
- padding-top: 1.5em;
- color: #e44;
-}
-
-.hero {
- padding-top: 0.75em;
- text-align: center;
- font-size: 1.75em;
-}
-
-.symbol {
- display: inline-block;
- color: #aaa;
-}
-
-.price {
- div {
- text-align: center;
- font-size: small;
- }
-}
-
-.empty {
- color: #aaa;
-}
diff --git a/js/packages/dapp-account/Shapeshift/shapeshift.js b/js/packages/dapp-account/Shapeshift/shapeshift.js
deleted file mode 100644
index 6b42f110b..000000000
--- a/js/packages/dapp-account/Shapeshift/shapeshift.js
+++ /dev/null
@@ -1,235 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { observer } from 'mobx-react';
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-
-import { Button, IdentityIcon, Portal } from '@parity/ui';
-import { CancelIcon, DoneIcon } from '@parity/ui/Icons';
-
-import shapeshiftLogo from '@parity/shared/assets/images/shapeshift-logo.png';
-
-import AwaitingDepositStep from './AwaitingDepositStep';
-import AwaitingExchangeStep from './AwaitingExchangeStep';
-import CompletedStep from './CompletedStep';
-import ErrorStep from './ErrorStep';
-import OptionsStep from './OptionsStep';
-import Store, { STAGE_COMPLETED, STAGE_OPTIONS, STAGE_WAIT_DEPOSIT, STAGE_WAIT_EXCHANGE } from './store';
-
-import styles from './shapeshift.css';
-
-const STAGE_TITLES = [
- ,
- ,
- ,
-
-];
-const ERROR_TITLE = (
-
-);
-
-@observer
-export default class Shapeshift extends Component {
- static contextTypes = {
- store: PropTypes.object.isRequired
- }
-
- static propTypes = {
- address: PropTypes.string.isRequired,
- onClose: PropTypes.func
- }
-
- store = new Store(this.props.address);
-
- componentDidMount () {
- this.store.retrieveCoins();
- }
-
- componentWillUnmount () {
- this.store.unsubscribe();
- }
-
- render () {
- const { error, stage } = this.store;
-
- return (
-
- { this.renderPage() }
-
- );
- }
-
- renderDialogActions () {
- const { address } = this.props;
- const { coins, error, hasAcceptedTerms, stage } = this.store;
-
- const logo = (
-
-
-
- );
- const cancelBtn = (
- }
- key='cancel'
- label={
-
- }
- onClick={ this.onClose }
- />
- );
-
- if (error) {
- return [
- logo,
- cancelBtn
- ];
- }
-
- switch (stage) {
- case STAGE_OPTIONS:
- return [
- logo,
- cancelBtn,
-
- }
- key='shift'
- label={
-
- }
- onClick={ this.onShift }
- />
- ];
-
- case STAGE_WAIT_DEPOSIT:
- case STAGE_WAIT_EXCHANGE:
- return [
- logo,
- cancelBtn
- ];
-
- case STAGE_COMPLETED:
- return [
- logo,
- }
- key='done'
- label={
-
- }
- onClick={ this.onClose }
- />
- ];
- }
- }
-
- renderPage () {
- const { error, stage } = this.store;
-
- if (error) {
- return (
-
- );
- }
-
- switch (stage) {
- case STAGE_OPTIONS:
- return (
-
- );
-
- case STAGE_WAIT_DEPOSIT:
- return (
-
- );
-
- case STAGE_WAIT_EXCHANGE:
- return (
-
- );
-
- case STAGE_COMPLETED:
- return (
-
- );
- }
- }
-
- onClose = () => {
- this.store.setStage(STAGE_OPTIONS);
- this.props.onClose && this.props.onClose();
- }
-
- onShift = () => {
- return this.store.shift();
- }
-}
diff --git a/js/packages/dapp-account/Shapeshift/shapeshift.spec.js b/js/packages/dapp-account/Shapeshift/shapeshift.spec.js
deleted file mode 100644
index e539f889e..000000000
--- a/js/packages/dapp-account/Shapeshift/shapeshift.spec.js
+++ /dev/null
@@ -1,160 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { shallow } from 'enzyme';
-import React from 'react';
-import sinon from 'sinon';
-
-import { STAGE_COMPLETED, STAGE_OPTIONS, STAGE_WAIT_DEPOSIT, STAGE_WAIT_EXCHANGE } from './store';
-import Shapeshift from './';
-
-const ADDRESS = '0x0123456789012345678901234567890123456789';
-
-let component;
-let instance;
-let onClose;
-
-function render (props = {}) {
- onClose = sinon.stub();
- component = shallow(
- ,
- { context: { store: {} } }
- );
- instance = component.instance();
-
- return component;
-}
-
-describe('views/Account/Shapeshift', () => {
- it('renders defaults', () => {
- expect(render()).to.be.ok;
- });
-
- describe('componentDidMount', () => {
- beforeEach(() => {
- render();
- sinon.stub(instance.store, 'retrieveCoins');
- return instance.componentDidMount();
- });
-
- afterEach(() => {
- instance.store.retrieveCoins.restore();
- });
-
- it('retrieves the list of coins when mounting', () => {
- expect(instance.store.retrieveCoins).to.have.been.called;
- });
- });
-
- describe('componentWillUnmount', () => {
- beforeEach(() => {
- render();
- sinon.stub(instance.store, 'unsubscribe');
- return instance.componentWillUnmount();
- });
-
- afterEach(() => {
- instance.store.unsubscribe.restore();
- });
-
- it('removes any subscriptions when unmounting', () => {
- expect(instance.store.unsubscribe).to.have.been.called;
- });
- });
-
- describe('renderDialogActions', () => {
- beforeEach(() => {
- render();
- });
-
- describe('shift button', () => {
- beforeEach(() => {
- sinon.stub(instance.store, 'shift').resolves();
-
- instance.store.setCoins(['BTC']);
- instance.store.toggleAcceptTerms();
- });
-
- afterEach(() => {
- instance.store.shift.restore();
- });
-
- it('disabled shift button when not accepted', () => {
- instance.store.toggleAcceptTerms();
- expect(shallow(instance.renderDialogActions()[2]).props().disabled).to.be.true;
- });
-
- it('shows shift button when accepted', () => {
- expect(shallow(instance.renderDialogActions()[2]).props().disabled).to.be.false;
- });
-
- it('calls the shift on store when clicked', () => {
- shallow(instance.renderDialogActions()[2]).simulate('touchTap');
- expect(instance.store.shift).to.have.been.called;
- });
- });
- });
-
- describe('renderPage', () => {
- beforeEach(() => {
- render();
- });
-
- it('renders ErrorStep on error, passing the store', () => {
- instance.store.setError('testError');
- const page = instance.renderPage();
-
- expect(page.type).to.match(/ErrorStep/);
- expect(page.props.store).to.equal(instance.store);
- });
-
- it('renders OptionsStep with STAGE_OPTIONS, passing the store', () => {
- instance.store.setStage(STAGE_OPTIONS);
- const page = instance.renderPage();
-
- expect(page.type).to.match(/OptionsStep/);
- expect(page.props.store).to.equal(instance.store);
- });
-
- it('renders AwaitingDepositStep with STAGE_WAIT_DEPOSIT, passing the store', () => {
- instance.store.setStage(STAGE_WAIT_DEPOSIT);
- const page = instance.renderPage();
-
- expect(page.type).to.match(/AwaitingDepositStep/);
- expect(page.props.store).to.equal(instance.store);
- });
-
- it('renders AwaitingExchangeStep with STAGE_WAIT_EXCHANGE, passing the store', () => {
- instance.store.setStage(STAGE_WAIT_EXCHANGE);
- const page = instance.renderPage();
-
- expect(page.type).to.match(/AwaitingExchangeStep/);
- expect(page.props.store).to.equal(instance.store);
- });
-
- it('renders CompletedStep with STAGE_COMPLETED, passing the store', () => {
- instance.store.setStage(STAGE_COMPLETED);
- const page = instance.renderPage();
-
- expect(page.type).to.match(/CompletedStep/);
- expect(page.props.store).to.equal(instance.store);
- });
- });
-});
diff --git a/js/packages/dapp-account/Shapeshift/store.js b/js/packages/dapp-account/Shapeshift/store.js
deleted file mode 100644
index fec9f9a9d..000000000
--- a/js/packages/dapp-account/Shapeshift/store.js
+++ /dev/null
@@ -1,199 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { action, observable, transaction } from 'mobx';
-
-import initShapeshift from '@parity/shapeshift/index';
-
-const STAGE_OPTIONS = 0;
-const STAGE_WAIT_DEPOSIT = 1;
-const STAGE_WAIT_EXCHANGE = 2;
-const STAGE_COMPLETED = 3;
-
-const WARNING_NONE = 0;
-const WARNING_NO_PRICE = -1;
-
-export default class Store {
- @observable address = null;
- @observable coinPair = 'btc_eth';
- @observable coinSymbol = 'BTC';
- @observable coins = [];
- @observable depositAddress = '';
- @observable depositInfo = null;
- @observable exchangeInfo = null;
- @observable error = null;
- @observable hasAcceptedTerms = false;
- @observable price = null;
- @observable refundAddress = '';
- @observable stage = STAGE_OPTIONS;
- @observable warning = 0;
-
- constructor (address) {
- this._shapeshiftApi = initShapeshift();
- this.address = address;
- }
-
- @action setCoins = (coins) => {
- this.coins = coins;
- }
-
- @action setCoinSymbol = (coinSymbol) => {
- transaction(() => {
- this.coinSymbol = coinSymbol;
- this.coinPair = `${coinSymbol.toLowerCase()}_eth`;
- this.price = null;
- });
-
- return this.getCoinPrice();
- }
-
- @action setDepositAddress = (depositAddress) => {
- this.depositAddress = depositAddress;
- }
-
- @action setDepositInfo = (depositInfo) => {
- transaction(() => {
- this.depositInfo = depositInfo;
- this.setStage(STAGE_WAIT_EXCHANGE);
- });
- }
-
- @action setError = (error) => {
- this.error = error;
- }
-
- @action setExchangeInfo = (exchangeInfo) => {
- transaction(() => {
- this.exchangeInfo = exchangeInfo;
- this.setStage(STAGE_COMPLETED);
- });
- }
-
- @action setPrice = (price) => {
- transaction(() => {
- this.price = price;
- this.setWarning();
- });
- }
-
- @action setRefundAddress = (refundAddress) => {
- this.refundAddress = refundAddress;
- }
-
- @action setStage = (stage) => {
- this.stage = stage;
- }
-
- @action setWarning = (warning = WARNING_NONE) => {
- this.warning = warning;
- }
-
- @action toggleAcceptTerms = () => {
- this.hasAcceptedTerms = !this.hasAcceptedTerms;
- }
-
- getCoinPrice () {
- return this._shapeshiftApi
- .getMarketInfo(this.coinPair)
- .then((price) => {
- this.setPrice(price);
- })
- .catch((error) => {
- console.warn('getCoinPrice', error);
-
- this.setWarning(WARNING_NO_PRICE);
- });
- }
-
- retrieveCoins () {
- return this._shapeshiftApi
- .getCoins()
- .then((coins) => {
- this.setCoins(Object.values(coins).filter((coin) => coin.status === 'available'));
-
- return this.getCoinPrice();
- })
- .catch((error) => {
- console.error('retrieveCoins', error);
- const message = `Failed to retrieve available coins from ShapeShift.io: ${error.message}`;
-
- this.setError(message);
- });
- }
-
- shift () {
- this.setStage(STAGE_WAIT_DEPOSIT);
-
- return this._shapeshiftApi
- .shift(this.address, this.refundAddress, this.coinPair)
- .then((result) => {
- console.log('onShift', result);
-
- this.setDepositAddress(result.deposit);
- return this.subscribe();
- })
- .catch((error) => {
- console.error('onShift', error);
- const message = `Failed to start exchange: ${error.message}`;
-
- this.setError(new Error(message));
- });
- }
-
- onExchangeInfo = (error, result) => {
- if (error) {
- console.error('onExchangeInfo', error);
-
- if (error.fatal) {
- this.setError(error);
- }
- return;
- }
-
- console.log('onExchangeInfo', result.status, result);
-
- switch (result.status) {
- case 'received':
- if (this.stage !== STAGE_WAIT_EXCHANGE) {
- this.setDepositInfo(result);
- }
- return;
-
- case 'complete':
- if (this.stage !== STAGE_COMPLETED) {
- this.setExchangeInfo(result);
- }
- return;
- }
- }
-
- subscribe () {
- return this._shapeshiftApi.subscribe(this.depositAddress, this.onExchangeInfo);
- }
-
- unsubscribe () {
- return this._shapeshiftApi.unsubscribe(this.depositAddress);
- }
-}
-
-export {
- STAGE_COMPLETED,
- STAGE_OPTIONS,
- STAGE_WAIT_DEPOSIT,
- STAGE_WAIT_EXCHANGE,
- WARNING_NONE,
- WARNING_NO_PRICE
-};
diff --git a/js/packages/dapp-account/Shapeshift/store.spec.js b/js/packages/dapp-account/Shapeshift/store.spec.js
deleted file mode 100644
index 099307fc6..000000000
--- a/js/packages/dapp-account/Shapeshift/store.spec.js
+++ /dev/null
@@ -1,355 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import sinon from 'sinon';
-
-import Store, { STAGE_COMPLETED, STAGE_OPTIONS, STAGE_WAIT_DEPOSIT, STAGE_WAIT_EXCHANGE, WARNING_NONE, WARNING_NO_PRICE } from './store';
-
-const ADDRESS = '0xabcdeffdecbaabcdeffdecbaabcdeffdecbaabcdeffdecba';
-
-describe('modals/Shapeshift/Store', () => {
- let store;
-
- beforeEach(() => {
- store = new Store(ADDRESS);
- });
-
- it('stores the ETH address', () => {
- expect(store.address).to.equal(ADDRESS);
- });
-
- it('defaults to BTC-ETH pair', () => {
- expect(store.coinSymbol).to.equal('BTC');
- expect(store.coinPair).to.equal('btc_eth');
- });
-
- it('defaults to stage STAGE_OPTIONS', () => {
- expect(store.stage).to.equal(STAGE_OPTIONS);
- });
-
- it('defaults to terms not accepted', () => {
- expect(store.hasAcceptedTerms).to.be.false;
- });
-
- describe('@action', () => {
- describe('setCoins', () => {
- it('sets the available coins', () => {
- const coins = ['BTC', 'ETC', 'XMR'];
-
- store.setCoins(coins);
- expect(store.coins.peek()).to.deep.equal(coins);
- });
- });
-
- describe('setCoinSymbol', () => {
- beforeEach(() => {
- sinon.stub(store, 'getCoinPrice');
- store.setCoinSymbol('XMR');
- });
-
- afterEach(() => {
- store.getCoinPrice.restore();
- });
-
- it('sets the coinSymbol', () => {
- expect(store.coinSymbol).to.equal('XMR');
- });
-
- it('sets the coinPair', () => {
- expect(store.coinPair).to.equal('xmr_eth');
- });
-
- it('resets the price retrieved', () => {
- expect(store.price).to.be.null;
- });
-
- it('retrieves the pair price', () => {
- expect(store.getCoinPrice).to.have.been.called;
- });
- });
-
- describe('setDepositAddress', () => {
- it('sets the depositAddress', () => {
- store.setDepositAddress('testing');
- expect(store.depositAddress).to.equal('testing');
- });
- });
-
- describe('setDepositInfo', () => {
- beforeEach(() => {
- store.setDepositInfo('testing');
- });
-
- it('sets the depositInfo', () => {
- expect(store.depositInfo).to.equal('testing');
- });
-
- it('sets the stage to STAGE_WAIT_EXCHANGE', () => {
- expect(store.stage).to.equal(STAGE_WAIT_EXCHANGE);
- });
- });
-
- describe('setError', () => {
- it('sets the error', () => {
- store.setError(new Error('testing'));
- expect(store.error).to.match(/testing/);
- });
- });
-
- describe('setExchangeInfo', () => {
- beforeEach(() => {
- store.setExchangeInfo('testing');
- });
-
- it('sets the exchangeInfo', () => {
- expect(store.exchangeInfo).to.equal('testing');
- });
-
- it('sets the stage to STAGE_COMPLETED', () => {
- expect(store.stage).to.equal(STAGE_COMPLETED);
- });
- });
-
- describe('setPrice', () => {
- it('sets the price', () => {
- store.setPrice('testing');
- expect(store.price).to.equal('testing');
- });
-
- it('clears any warnings once set', () => {
- store.setWarning(-999);
- store.setPrice('testing');
- expect(store.warning).to.equal(WARNING_NONE);
- });
- });
-
- describe('setRefundAddress', () => {
- it('sets the price', () => {
- store.setRefundAddress('testing');
- expect(store.refundAddress).to.equal('testing');
- });
- });
-
- describe('setStage', () => {
- it('sets the state', () => {
- store.setStage('testing');
- expect(store.stage).to.equal('testing');
- });
- });
-
- describe('setWarning', () => {
- it('sets the warning', () => {
- store.setWarning(-999);
-
- expect(store.warning).to.equal(-999);
- });
-
- it('clears the warning with no parameters', () => {
- store.setWarning(-999);
- store.setWarning();
-
- expect(store.warning).to.equal(WARNING_NONE);
- });
- });
-
- describe('toggleAcceptTerms', () => {
- it('changes state on hasAcceptedTerms', () => {
- store.toggleAcceptTerms();
- expect(store.hasAcceptedTerms).to.be.true;
- });
- });
- });
-
- describe('operations', () => {
- describe('getCoinPrice', () => {
- beforeEach(() => {
- sinon.stub(store._shapeshiftApi, 'getMarketInfo').resolves('testPrice');
- return store.getCoinPrice();
- });
-
- afterEach(() => {
- store._shapeshiftApi.getMarketInfo.restore();
- });
-
- it('retrieves the market info from ShapeShift', () => {
- expect(store._shapeshiftApi.getMarketInfo).to.have.been.calledWith('btc_eth');
- });
-
- it('stores the price retrieved', () => {
- expect(store.price).to.equal('testPrice');
- });
-
- it('sets a warning on failure', () => {
- store._shapeshiftApi.getMarketInfo.restore();
- sinon.stub(store._shapeshiftApi, 'getMarketInfo').rejects('someError');
-
- return store.getCoinPrice().then(() => {
- expect(store.warning).to.equal(WARNING_NO_PRICE);
- });
- });
- });
-
- describe('retrieveCoins', () => {
- beforeEach(() => {
- sinon.stub(store._shapeshiftApi, 'getCoins').resolves({
- BTC: { symbol: 'BTC', status: 'available' },
- ETC: { symbol: 'ETC' },
- XMR: { symbol: 'XMR', status: 'available' }
- });
- sinon.stub(store, 'getCoinPrice');
- return store.retrieveCoins();
- });
-
- afterEach(() => {
- store._shapeshiftApi.getCoins.restore();
- store.getCoinPrice.restore();
- });
-
- it('retrieves the coins from ShapeShift', () => {
- expect(store._shapeshiftApi.getCoins).to.have.been.called;
- });
-
- it('sets the available coins', () => {
- expect(store.coins.peek()).to.deep.equal([
- { status: 'available', symbol: 'BTC' },
- { status: 'available', symbol: 'XMR' }
- ]);
- });
-
- it('retrieves the price once resolved', () => {
- expect(store.getCoinPrice).to.have.been.called;
- });
- });
-
- describe('shift', () => {
- beforeEach(() => {
- sinon.stub(store, 'subscribe').resolves();
- sinon.stub(store._shapeshiftApi, 'shift').resolves({ deposit: 'depositAddress' });
- store.setRefundAddress('refundAddress');
-
- return store.shift();
- });
-
- afterEach(() => {
- store.subscribe.restore();
- store._shapeshiftApi.shift.restore();
- });
-
- it('moves to stage STAGE_WAIT_DEPOSIT', () => {
- expect(store.stage).to.equal(STAGE_WAIT_DEPOSIT);
- });
-
- it('calls ShapeShift with the correct parameters', () => {
- expect(store._shapeshiftApi.shift).to.have.been.calledWith(ADDRESS, 'refundAddress', store.coinPair);
- });
-
- it('sets the depositAddress', () => {
- expect(store.depositAddress).to.equal('depositAddress');
- });
-
- it('subscribes to updates', () => {
- expect(store.subscribe).to.have.been.called;
- });
-
- it('sets error when shift fails', () => {
- store._shapeshiftApi.shift.restore();
- sinon.stub(store._shapeshiftApi, 'shift').rejects({ message: 'testingError' });
-
- return store.shift().then(() => {
- expect(store.error).to.match(/testingError/);
- });
- });
- });
-
- describe('subscribe', () => {
- beforeEach(() => {
- sinon.stub(store._shapeshiftApi, 'subscribe');
- store.setDepositAddress('depositAddress');
- return store.subscribe();
- });
-
- afterEach(() => {
- store._shapeshiftApi.subscribe.restore();
- });
-
- it('calls into the ShapeShift subscribe', () => {
- expect(store._shapeshiftApi.subscribe).to.have.been.calledWith('depositAddress', store.onExchangeInfo);
- });
-
- describe('onExchangeInfo', () => {
- it('sets the error when fatal error retrieved', () => {
- store.onExchangeInfo({ fatal: true, message: 'testing' });
- expect(store.error.message).to.equal('testing');
- });
-
- it('does not set the error when non-fatal error retrieved', () => {
- store.onExchangeInfo({ message: 'testing' });
- expect(store.error).to.be.null;
- });
-
- describe('status received', () => {
- const INFO = { status: 'received' };
-
- beforeEach(() => {
- store.onExchangeInfo(null, INFO);
- });
-
- it('sets the depositInfo', () => {
- expect(store.depositInfo).to.deep.equal(INFO);
- });
-
- it('only advanced depositInfo once', () => {
- store.onExchangeInfo(null, Object.assign({}, INFO, { state: 'secondTime' }));
- expect(store.depositInfo).to.deep.equal(INFO);
- });
- });
-
- describe('status completed', () => {
- const INFO = { status: 'complete' };
-
- beforeEach(() => {
- store.onExchangeInfo(null, INFO);
- });
-
- it('sets the depositInfo', () => {
- expect(store.exchangeInfo).to.deep.equal(INFO);
- });
-
- it('only advanced depositInfo once', () => {
- store.onExchangeInfo(null, Object.assign({}, INFO, { state: 'secondTime' }));
- expect(store.exchangeInfo).to.deep.equal(INFO);
- });
- });
- });
- });
-
- describe('unsubscribe', () => {
- beforeEach(() => {
- sinon.stub(store._shapeshiftApi, 'unsubscribe');
- store.setDepositAddress('depositAddress');
- return store.unsubscribe();
- });
-
- afterEach(() => {
- store._shapeshiftApi.unsubscribe.restore();
- });
-
- it('calls into the ShapeShift unsubscribe', () => {
- expect(store._shapeshiftApi.unsubscribe).to.have.been.calledWith('depositAddress');
- });
- });
- });
-});
diff --git a/js/packages/dapp-account/Transactions/index.js b/js/packages/dapp-account/Transactions/index.js
deleted file mode 100644
index 0ba7422c9..000000000
--- a/js/packages/dapp-account/Transactions/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './transactions';
diff --git a/js/packages/dapp-account/Transactions/store.js b/js/packages/dapp-account/Transactions/store.js
deleted file mode 100644
index e0ec39b5e..000000000
--- a/js/packages/dapp-account/Transactions/store.js
+++ /dev/null
@@ -1,118 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { action, observable, transaction } from 'mobx';
-
-import etherscan from '@parity/etherscan/index';
-
-export default class Store {
- @observable address = null;
- @observable isLoading = false;
- @observable isTracing = false;
- @observable netVersion = '0';
- @observable txHashes = [];
-
- constructor (api) {
- this._api = api;
- }
-
- @action setHashes = (transactions) => {
- transaction(() => {
- this.setLoading(false);
- this.txHashes = transactions.map((transaction) => transaction.hash);
- });
- }
-
- @action setAddress = (address) => {
- this.address = address;
- }
-
- @action setLoading = (isLoading) => {
- this.isLoading = isLoading;
- }
-
- @action setNetVersion = (netVersion) => {
- this.netVersion = netVersion;
- }
-
- @action setTracing = (isTracing) => {
- this.isTracing = isTracing;
- }
-
- @action updateProps = (props) => {
- transaction(() => {
- this.setAddress(props.address);
- this.setNetVersion(props.netVersion);
-
- // TODO: When tracing is enabled again, adjust to actually set
- this.setTracing(false && props.traceMode);
- });
-
- return this.getTransactions();
- }
-
- getTransactions () {
- if (this.netVersion === '0') {
- return Promise.resolve();
- }
-
- this.setLoading(true);
-
- // TODO: When supporting other chains (eg. ETC). call to be made to other endpoints
- return (
- this.isTracing
- ? this.fetchTraceTransactions()
- : this.fetchEtherscanTransactions()
- )
- .then((transactions) => {
- this.setHashes(transactions);
- })
- .catch((error) => {
- console.warn('getTransactions', error);
- this.setLoading(false);
- });
- }
-
- fetchEtherscanTransactions () {
- return etherscan.account.transactions(this.address, 0, false, this.netVersion);
- }
-
- fetchTraceTransactions () {
- return Promise
- .all([
- this._api.trace.filter({
- fromAddress: this.address,
- fromBlock: 0
- }),
- this._api.trace.filter({
- fromBlock: 0,
- toAddress: this.address
- })
- ])
- .then(([fromTransactions, toTransactions]) => {
- return fromTransactions
- .concat(toTransactions)
- .map((transaction) => {
- return {
- blockNumber: transaction.blockNumber,
- from: transaction.action.from,
- hash: transaction.transactionHash,
- to: transaction.action.to
- };
- });
- });
- }
-}
diff --git a/js/packages/dapp-account/Transactions/store.spec.js b/js/packages/dapp-account/Transactions/store.spec.js
deleted file mode 100644
index 4337e8425..000000000
--- a/js/packages/dapp-account/Transactions/store.spec.js
+++ /dev/null
@@ -1,193 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import BigNumber from 'bignumber.js';
-import sinon from 'sinon';
-
-import { mockget as mockEtherscan } from '@parity/etherscan/helpers.spec.js';
-import { ADDRESS, createApi } from './transactions.test.js';
-
-import Store from './store';
-
-let api;
-let store;
-
-function createStore () {
- api = createApi();
- store = new Store(api);
-
- return store;
-}
-
-function mockQuery () {
- mockEtherscan([{
- query: {
- module: 'account',
- action: 'txlist',
- address: ADDRESS,
- offset: 25,
- page: 1,
- sort: 'desc'
- },
- reply: [{ hash: '123' }]
- }], false, '42');
-}
-
-describe('views/Account/Transactions/store', () => {
- beforeEach(() => {
- mockQuery();
- createStore();
- });
-
- describe('constructor', () => {
- it('sets the api', () => {
- expect(store._api).to.deep.equals(api);
- });
-
- it('starts with isLoading === false', () => {
- expect(store.isLoading).to.be.false;
- });
-
- it('starts with isTracing === false', () => {
- expect(store.isTracing).to.be.false;
- });
- });
-
- describe('@action', () => {
- describe('setHashes', () => {
- it('clears the loading state', () => {
- store.setLoading(true);
- store.setHashes([]);
- expect(store.isLoading).to.be.false;
- });
-
- it('sets the hashes from the transactions', () => {
- store.setHashes([{ hash: '123' }, { hash: '456' }]);
- expect(store.txHashes.peek()).to.deep.equal(['123', '456']);
- });
- });
-
- describe('setAddress', () => {
- it('sets the address', () => {
- store.setAddress(ADDRESS);
- expect(store.address).to.equal(ADDRESS);
- });
- });
-
- describe('setLoading', () => {
- it('sets the isLoading flag', () => {
- store.setLoading(true);
- expect(store.isLoading).to.be.true;
- });
- });
-
- describe('setNetVersion', () => {
- it('sets the netVersion', () => {
- store.setNetVersion('testing');
- expect(store.netVersion).to.equal('testing');
- });
- });
-
- describe('setTracing', () => {
- it('sets the isTracing flag', () => {
- store.setTracing(true);
- expect(store.isTracing).to.be.true;
- });
- });
-
- describe('updateProps', () => {
- it('retrieves transactions once updated', () => {
- sinon.spy(store, 'getTransactions');
- store.updateProps({});
-
- expect(store.getTransactions).to.have.been.called;
- store.getTransactions.restore();
- });
- });
- });
-
- describe('operations', () => {
- describe('getTransactions', () => {
- it('retrieves the hashes via etherscan', () => {
- sinon.spy(store, 'fetchEtherscanTransactions');
- store.setAddress(ADDRESS);
- store.setNetVersion('42');
- store.setTracing(false);
-
- return store.getTransactions().then(() => {
- expect(store.fetchEtherscanTransactions).to.have.been.called;
- expect(store.txHashes.peek()).to.deep.equal(['123']);
- store.fetchEtherscanTransactions.restore();
- });
- });
-
- it('retrieves the hashes via tracing', () => {
- sinon.spy(store, 'fetchTraceTransactions');
- store.setAddress(ADDRESS);
- store.setNetVersion('42');
- store.setTracing(true);
-
- return store.getTransactions().then(() => {
- expect(store.fetchTraceTransactions).to.have.been.called;
- expect(store.txHashes.peek()).to.deep.equal(['123', '098']);
- store.fetchTraceTransactions.restore();
- });
- });
- });
-
- describe('fetchEtherscanTransactions', () => {
- it('retrieves the transactions', () => {
- store.setAddress(ADDRESS);
- store.setNetVersion('42');
-
- return store.fetchEtherscanTransactions().then((transactions) => {
- expect(transactions).to.deep.equal([{
- blockNumber: new BigNumber(0),
- from: '',
- hash: '123',
- timeStamp: undefined,
- to: '',
- value: undefined
- }]);
- });
- });
- });
-
- describe('fetchTraceTransactions', () => {
- it('retrieves the transactions', () => {
- store.setAddress(ADDRESS);
- store.setNetVersion('42');
-
- return store.fetchTraceTransactions().then((transactions) => {
- expect(transactions).to.deep.equal([
- {
- blockNumber: undefined,
- from: undefined,
- hash: '123',
- to: undefined
- },
- {
- blockNumber: undefined,
- from: undefined,
- hash: '098',
- to: undefined
- }
- ]);
- });
- });
- });
- });
-});
diff --git a/js/packages/dapp-account/Transactions/transactions.css b/js/packages/dapp-account/Transactions/transactions.css
deleted file mode 100644
index a09d0bddc..000000000
--- a/js/packages/dapp-account/Transactions/transactions.css
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.infonone {
- opacity: 0.25;
-}
-
-.etherscan {
- text-align: right;
- padding-top: 1em;
- font-size: 0.75em;
- color: #aaa;
-}
diff --git a/js/packages/dapp-account/Transactions/transactions.js b/js/packages/dapp-account/Transactions/transactions.js
deleted file mode 100644
index 7ea8f79b7..000000000
--- a/js/packages/dapp-account/Transactions/transactions.js
+++ /dev/null
@@ -1,127 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { observer } from 'mobx-react';
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-import { connect } from 'react-redux';
-
-import { Container, TxList, Loading } from '@parity/ui';
-
-import Store from './store';
-import styles from './transactions.css';
-
-@observer
-class Transactions extends Component {
- static contextTypes = {
- api: PropTypes.object.isRequired
- }
-
- static propTypes = {
- address: PropTypes.string.isRequired,
- netVersion: PropTypes.string.isRequired,
- traceMode: PropTypes.bool
- }
-
- store = new Store(this.context.api);
-
- componentWillMount () {
- this.store.updateProps(this.props);
- }
-
- componentWillReceiveProps (newProps) {
- if (this.props.traceMode === undefined && newProps.traceMode !== undefined) {
- this.store.updateProps(newProps);
- return;
- }
-
- const hasChanged = ['address', 'netVersion']
- .map(key => newProps[key] !== this.props[key])
- .reduce((truth, keyTruth) => truth || keyTruth, false);
-
- if (hasChanged) {
- this.store.updateProps(newProps);
- }
- }
-
- render () {
- return (
-
- }
- >
- { this.renderTransactionList() }
- { this.renderEtherscanFooter() }
-
- );
- }
-
- renderTransactionList () {
- const { address, isLoading, txHashes } = this.store;
-
- if (isLoading) {
- return (
-
- );
- }
-
- return (
-
- );
- }
-
- renderEtherscanFooter () {
- const { isTracing } = this.store;
-
- if (isTracing) {
- return null;
- }
-
- return (
-
- etherscan.io
- } }
- />
-
- );
- }
-}
-
-function mapStateToProps (state) {
- const { netVersion, traceMode } = state.nodeStatus;
-
- return {
- netVersion,
- traceMode
- };
-}
-
-export default connect(
- mapStateToProps,
- null
-)(Transactions);
diff --git a/js/packages/dapp-account/Transactions/transactions.spec.js b/js/packages/dapp-account/Transactions/transactions.spec.js
deleted file mode 100644
index 8b39206eb..000000000
--- a/js/packages/dapp-account/Transactions/transactions.spec.js
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { shallow } from 'enzyme';
-import React from 'react';
-
-import { ADDRESS, createApi, createRedux } from './transactions.test.js';
-
-import Transactions from './';
-
-let component;
-let instance;
-
-function render (props) {
- component = shallow(
- ,
- { context: { store: createRedux() } }
- ).find('Transactions').shallow({ context: { api: createApi() } });
- instance = component.instance();
-
- return component;
-}
-
-describe('views/Account/Transactions', () => {
- it('renders defaults', () => {
- expect(render()).to.be.ok;
- });
-
- describe('renderTransactionList', () => {
- it('renders Loading when isLoading === true', () => {
- instance.store.setLoading(true);
- expect(instance.renderTransactionList().type).to.match(/Loading/);
- });
-
- it('renders TxList when isLoading === true', () => {
- instance.store.setLoading(false);
- expect(instance.renderTransactionList().type).to.match(/Connect/);
- });
- });
-});
diff --git a/js/packages/dapp-account/Transactions/transactions.test.js b/js/packages/dapp-account/Transactions/transactions.test.js
deleted file mode 100644
index abfc150ac..000000000
--- a/js/packages/dapp-account/Transactions/transactions.test.js
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { ADDRESS, createRedux } from '../account.test.js';
-
-function createApi () {
- return {
- trace: {
- filter: (options) => Promise.resolve([{ transactionHash: options.fromAddress ? '123' : '098', action: {} }])
- }
- };
-}
-
-export {
- ADDRESS,
- createApi,
- createRedux
-};
diff --git a/js/packages/dapp-account/Transfer/Details/details.js b/js/packages/dapp-account/Transfer/Details/details.js
deleted file mode 100644
index fe7f03db2..000000000
--- a/js/packages/dapp-account/Transfer/Details/details.js
+++ /dev/null
@@ -1,243 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-
-import { nullableProptype } from '@parity/shared/util/proptypes';
-import Form, { AddressSelect, Checkbox, Input, InputAddressSelect, Label } from '@parity/ui/Form';
-
-import TokenSelect from './tokenSelect';
-import styles from '../transfer.css';
-
-export const CHECK_STYLE = {
- position: 'absolute',
- top: '38px',
- left: '1em'
-};
-
-export default class Details extends Component {
- static propTypes = {
- address: PropTypes.string,
- balance: PropTypes.object,
- all: PropTypes.bool,
- extras: PropTypes.bool,
- sender: PropTypes.string,
- senderError: PropTypes.string,
- recipient: PropTypes.string,
- recipientError: PropTypes.string,
- token: PropTypes.object,
- total: PropTypes.string,
- totalError: PropTypes.string,
- value: PropTypes.string,
- valueError: PropTypes.string,
- onChange: PropTypes.func.isRequired,
- wallet: PropTypes.object,
- senders: nullableProptype(PropTypes.object)
- };
-
- static defaultProps = {
- wallet: null,
- senders: null
- };
-
- render () {
- const { all, extras, token, total, totalError, value, valueError } = this.props;
- const label = (
-
- );
-
- let totalAmountStyle = { color: 'rgba(0,0,0,.87)' };
-
- if (totalError) {
- totalAmountStyle = { color: '#9F3A38' };
- }
-
- return (
-
- );
- }
-
- renderFromAddress () {
- const { sender, senderError, senders } = this.props;
-
- if (!senders) {
- return null;
- }
-
- return (
-
- );
- }
-
- renderTokenSelect () {
- const { balance, token } = this.props;
-
- return (
-
- );
- }
-
- onChangeToken = (event, token) => {
- this.props.onChange('token', token);
- }
-
- onEditSender = (event, sender) => {
- this.props.onChange('sender', sender);
- }
-
- onEditRecipient = (event, recipient) => {
- this.props.onChange('recipient', recipient);
- }
-
- onEditValue = (event) => {
- this.props.onChange('value', event.target.value);
- }
-
- onCheckAll = () => {
- this.props.onChange('all', !this.props.all);
- }
-
- onCheckExtras = () => {
- this.props.onChange('extras', !this.props.extras);
- }
-
- onContacts = () => {
- this.setState({
- showAddresses: true
- });
- }
-}
diff --git a/js/packages/dapp-account/Transfer/Details/index.js b/js/packages/dapp-account/Transfer/Details/index.js
deleted file mode 100644
index b5dd07dd5..000000000
--- a/js/packages/dapp-account/Transfer/Details/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './details';
diff --git a/js/packages/dapp-account/Transfer/Details/tokenSelect.js b/js/packages/dapp-account/Transfer/Details/tokenSelect.js
deleted file mode 100644
index 44fdf31bf..000000000
--- a/js/packages/dapp-account/Transfer/Details/tokenSelect.js
+++ /dev/null
@@ -1,130 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import BigNumber from 'bignumber.js';
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { connect } from 'react-redux';
-import { isEqual } from 'lodash';
-
-import { Dropdown, TokenImage } from '@parity/ui';
-
-import styles from '../transfer.css';
-
-class TokenSelect extends Component {
- static contextTypes = {
- api: PropTypes.object
- };
-
- static propTypes = {
- onChange: PropTypes.func.isRequired,
- balance: PropTypes.object.isRequired,
- tokens: PropTypes.object.isRequired,
- value: PropTypes.string.isRequired
- };
-
- componentWillMount () {
- this.computeTokens();
- }
-
- componentWillReceiveProps (nextProps) {
- const prevTokens = Object.keys(this.props.balance)
- .map((tokenId) => `${tokenId}_${this.props.balance[tokenId].toNumber()}`);
- const nextTokens = Object.keys(nextProps.balance)
- .map((tokenId) => `${tokenId}_${nextProps.balance[tokenId].toNumber()}`);
-
- if (!isEqual(prevTokens, nextTokens)) {
- this.computeTokens(nextProps);
- }
- }
-
- computeTokens (props = this.props) {
- const { api } = this.context;
- const { balance, tokens } = this.props;
-
- const items = Object
- .keys(balance)
- .map((tokenId) => {
- const token = tokens[tokenId];
- const tokenValue = balance[tokenId];
- const isEth = token.native;
-
- if (!isEth && tokenValue.eq(0)) {
- return null;
- }
-
- let value = 0;
-
- if (isEth) {
- value = api.util.fromWei(tokenValue).toFormat(3);
- } else {
- const format = token.format || 1;
- const decimals = format === 1 ? 0 : Math.min(3, Math.floor(format / 10));
-
- value = new BigNumber(tokenValue).div(format).toFormat(decimals);
- }
-
- const label = (
-
-
-
- { token.name }
-
-
- { value } { token.tag }
-
-
- );
-
- return {
- key: tokenId,
- text: token.name,
- value: token.id,
- content: label
- };
- })
- .filter((node) => node);
-
- this.setState({ items });
- }
-
- render () {
- const { onChange, value } = this.props;
- const { items } = this.state;
-
- return (
-
- );
- }
-}
-
-function mapStateToProps (state) {
- const { tokens } = state;
-
- return { tokens };
-}
-
-export default connect(
- mapStateToProps,
- null
-)(TokenSelect);
diff --git a/js/packages/dapp-account/Transfer/Extras/extras.js b/js/packages/dapp-account/Transfer/Extras/extras.js
deleted file mode 100644
index 04400d677..000000000
--- a/js/packages/dapp-account/Transfer/Extras/extras.js
+++ /dev/null
@@ -1,88 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-
-import { GasPriceEditor, Form, Input } from '@parity/ui';
-
-import styles from '../transfer.css';
-
-export default class Extras extends Component {
- static propTypes = {
- data: PropTypes.string,
- dataError: PropTypes.string,
- hideData: PropTypes.bool,
- gasStore: PropTypes.object.isRequired,
- isEth: PropTypes.bool,
- onChange: PropTypes.func,
- total: PropTypes.string,
- totalError: PropTypes.string
- };
-
- static defaultProps = {
- hideData: false
- };
-
- render () {
- const { gasStore, onChange } = this.props;
-
- return (
-
- );
- }
-
- renderData () {
- const { isEth, data, dataError, hideData } = this.props;
-
- if (!isEth || hideData) {
- return null;
- }
-
- return (
-
- }
- label={
-
- }
- onChange={ this.onEditData }
- value={ data }
- />
- );
- }
-
- onEditData = (event) => {
- this.props.onChange('data', event.target.value);
- }
-}
diff --git a/js/packages/dapp-account/Transfer/Extras/index.js b/js/packages/dapp-account/Transfer/Extras/index.js
deleted file mode 100644
index 98909db40..000000000
--- a/js/packages/dapp-account/Transfer/Extras/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './extras';
diff --git a/js/packages/dapp-account/Transfer/errors.js b/js/packages/dapp-account/Transfer/errors.js
deleted file mode 100644
index 57ea1ed53..000000000
--- a/js/packages/dapp-account/Transfer/errors.js
+++ /dev/null
@@ -1,28 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-const ERRORS = {
- requireSender: 'A valid sender is required for the transaction',
- requireRecipient: 'A recipient network address is required for the transaction',
- invalidAddress: 'The supplied address is an invalid network address',
- invalidAmount: 'The supplied amount should be a valid positive number',
- invalidDecimals: 'The supplied amount exceeds the allowed decimals',
- largeAmount: 'The transaction total is higher than the available balance',
- gasException: 'The transaction will throw an exception with the current values',
- gasBlockLimit: 'The transaction execution will exceed the block gas limit'
-};
-
-export default ERRORS;
diff --git a/js/packages/dapp-account/Transfer/index.js b/js/packages/dapp-account/Transfer/index.js
deleted file mode 100644
index e366ead6d..000000000
--- a/js/packages/dapp-account/Transfer/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './transfer';
diff --git a/js/packages/dapp-account/Transfer/store.js b/js/packages/dapp-account/Transfer/store.js
deleted file mode 100644
index d271accbb..000000000
--- a/js/packages/dapp-account/Transfer/store.js
+++ /dev/null
@@ -1,586 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { noop } from 'lodash';
-import { observable, computed, action, transaction } from 'mobx';
-import BigNumber from 'bignumber.js';
-
-import Contract from '@parity/api/contract';
-import { fromWei } from '@parity/api/util/wei';
-import { getLogger, LOG_KEYS } from '@parity/shared/config';
-import { eip20 as tokenAbi, wallet as walletAbi } from '@parity/shared/contracts/abi';
-import { DEFAULT_GAS, DEFAULT_GASPRICE, MAX_GAS_ESTIMATION } from '@parity/shared/util/constants';
-import { ETH_TOKEN } from '@parity/shared/util/tokens';
-import GasPriceStore from '@parity/ui/GasPriceEditor/store';
-
-import ERRORS from './errors';
-
-const log = getLogger(LOG_KEYS.TransferModalStore);
-
-const TITLES = {
- transfer: 'transfer details',
- extras: 'extra information'
-};
-const STAGES_BASIC = [TITLES.transfer];
-const STAGES_EXTRA = [TITLES.transfer, TITLES.extras];
-
-export const WALLET_WARNING_SPENT_TODAY_LIMIT = 'WALLET_WARNING_SPENT_TODAY_LIMIT';
-
-export default class TransferStore {
- @observable stage = 0;
- @observable extras = false;
- @observable isEth = true;
- @observable valueAll = false;
- @observable sending = false;
- @observable token = ETH_TOKEN;
-
- @observable data = '';
- @observable dataError = null;
-
- @observable recipient = '';
- @observable recipientError = ERRORS.requireRecipient;
-
- @observable sender = '';
- @observable senderError = null;
- @observable sendersBalances = {};
-
- @observable total = '0.0';
- @observable totalError = null;
-
- @observable value = '0.0';
- @observable valueError = null;
-
- @observable walletWarning = null;
-
- account = null;
- balance = null;
-
- onClose = noop;
- senders = null;
- isWallet = false;
- tokenContract = null;
- tokens = {};
- wallet = null;
-
- gasStore = null;
-
- constructor (api, props) {
- this.api = api;
-
- const { account, balance, gasLimit, onClose, senders, newError, sendersBalances, tokens } = props;
-
- this.account = account;
- this.balance = balance;
- this.isWallet = account && account.wallet;
- this.newError = newError;
- this.tokens = tokens;
-
- this.gasStore = new GasPriceStore(api, { gasLimit });
- this.tokenContract = api.newContract(tokenAbi, '');
-
- if (this.isWallet) {
- this.wallet = props.wallet;
- this.walletContract = new Contract(this.api, walletAbi);
- }
-
- if (senders) {
- this.senders = senders;
- this.sendersBalances = sendersBalances;
- this.senderError = ERRORS.requireSender;
- }
-
- if (onClose) {
- this.onClose = onClose;
- }
- }
-
- @computed get steps () {
- const steps = [].concat(this.extras ? STAGES_EXTRA : STAGES_BASIC);
-
- return steps;
- }
-
- @computed get isValid () {
- const detailsValid = !this.recipientError && !this.valueError && !this.totalError && !this.senderError;
- const extrasValid = !this.gasStore.errorGas && !this.gasStore.errorPrice && !this.gasStore.conditionBlockError && !this.totalError;
- const verifyValid = !this.passwordError;
-
- switch (this.stage) {
- case 0:
- return detailsValid;
-
- case 1:
- return this.extras
- ? extrasValid
- : verifyValid;
-
- case 2:
- return verifyValid;
- }
- }
-
- @action onNext = () => {
- this.stage += 1;
- }
-
- @action onPrev = () => {
- this.stage -= 1;
- }
-
- @action handleClose = () => {
- this.stage = 0;
- this.onClose();
- }
-
- @action onUpdateDetails = (type, value) => {
- switch (type) {
- case 'all':
- return this._onUpdateAll(value);
-
- case 'extras':
- return this._onUpdateExtras(value);
-
- case 'data':
- return this._onUpdateData(value);
-
- case 'gas':
- return this._onUpdateGas(value);
-
- case 'gasPrice':
- return this._onUpdateGasPrice(value);
-
- case 'recipient':
- return this._onUpdateRecipient(value);
-
- case 'sender':
- return this._onUpdateSender(value);
-
- case 'token':
- return this._onUpdateToken(value);
-
- case 'value':
- return this._onUpdateValue(value);
- }
- }
-
- @action onSend = () => {
- this.onNext();
- this.sending = true;
-
- this
- .send()
- .catch((error) => {
- this.newError(error);
- })
- .then(() => {
- this.handleClose();
- });
- }
-
- @action _onUpdateAll = (valueAll) => {
- this.valueAll = valueAll;
- this.recalculateGas();
- }
-
- @action _onUpdateExtras = (extras) => {
- this.extras = extras;
- }
-
- @action _onUpdateData = (data) => {
- this.data = data;
- this.recalculateGas();
- }
-
- @action _onUpdateGas = (gas) => {
- this.recalculate();
- }
-
- @action _onUpdateGasPrice = (gasPrice) => {
- this.recalculate();
- }
-
- @action _onUpdateRecipient = (recipient) => {
- let recipientError = null;
-
- if (!recipient || !recipient.length) {
- recipientError = ERRORS.requireRecipient;
- } else if (!this.api.util.isAddressValid(recipient)) {
- recipientError = ERRORS.invalidAddress;
- }
-
- transaction(() => {
- this.recipient = recipient;
- this.recipientError = recipientError;
-
- this.recalculateGas();
- });
- }
-
- @action _onUpdateSender = (sender) => {
- let senderError = null;
-
- if (!sender || !sender.length) {
- senderError = ERRORS.requireSender;
- } else if (!this.api.util.isAddressValid(sender)) {
- senderError = ERRORS.invalidAddress;
- }
-
- transaction(() => {
- this.sender = sender;
- this.senderError = senderError;
-
- this.recalculateGas();
- });
- }
-
- @action _onUpdateToken = (tokenId) => {
- transaction(() => {
- this.token = { ...this.tokens[tokenId] };
- this.isEth = this.token.native;
-
- this.recalculateGas();
- });
- }
-
- @action _onUpdateValue = (value) => {
- let valueError = this._validatePositiveNumber(value);
-
- if (!valueError) {
- valueError = this._validateDecimals(value);
- }
-
- if (this.isWallet && !valueError) {
- const { last, limit, spent } = this.wallet.dailylimit;
- const remains = fromWei(limit.minus(spent));
- const today = Math.round(Date.now() / (24 * 3600 * 1000));
- const isResetable = last.lt(today);
-
- if ((!isResetable && remains.lt(value)) || fromWei(limit).lt(value)) {
- // already spent too much today
- this.walletWarning = WALLET_WARNING_SPENT_TODAY_LIMIT;
- } else if (this.walletWarning) {
- // all ok
- this.walletWarning = null;
- }
- }
-
- transaction(() => {
- this.value = value;
- this.valueError = valueError;
-
- this.recalculateGas();
- });
- }
-
- @action recalculateGas = (redo = true) => {
- if (!this.isValid) {
- return this.recalculate(redo);
- }
-
- return this
- .estimateGas()
- .then((gasEst) => {
- let gas = gasEst;
-
- if (gas.gt(DEFAULT_GAS)) {
- gas = gas.mul(1.2);
- }
-
- transaction(() => {
- this.gasStore.setEstimated(gasEst.toFixed(0));
- this.gasStore.setGas(gas.toFixed(0));
-
- this.recalculate(redo);
- });
- })
- .catch((error) => {
- this.gasStore.setEstimatedError();
- console.warn('etimateGas', error);
- this.recalculate(redo);
- });
- }
-
- getBalance (forceSender = false) {
- if (this.isWallet && !forceSender) {
- return this.balance;
- }
-
- const balance = this.senders
- ? this.sendersBalances[this.sender]
- : this.balance;
-
- return balance;
- }
-
- /**
- * Return the balance of the selected token
- * (in WEI for ETH, without formating for other tokens)
- */
- getTokenBalance (token = this.token, forceSender = false) {
- return new BigNumber(this.balance[token.id] || 0);
- }
-
- getTokenValue (token = this.token, value = this.value, inverse = false) {
- let _value;
-
- try {
- _value = new BigNumber(value || 0);
- } catch (error) {
- _value = new BigNumber(0);
- }
-
- if (inverse) {
- return _value.div(token.format);
- }
-
- return _value.mul(token.format);
- }
-
- getValues (_gasTotal) {
- const gasTotal = new BigNumber(_gasTotal || 0);
- const { valueAll, isEth, isWallet } = this;
-
- log.debug('@getValues', 'gas', gasTotal.toFormat());
-
- if (!valueAll) {
- const value = this.getTokenValue();
-
- // If it's a token or a wallet, eth is the estimated gas,
- // and value is the user input
- if (!isEth || isWallet) {
- return {
- eth: gasTotal,
- token: value
- };
- }
-
- // Otherwise, eth is the sum of the gas and the user input
- const totalEthValue = gasTotal.plus(value);
-
- return {
- eth: totalEthValue,
- token: value
- };
- }
-
- // If it's the total balance that needs to be sent, send the total balance
- // if it's not a proper ETH transfer
- if (!isEth || isWallet) {
- const tokenBalance = this.getTokenBalance();
-
- return {
- eth: gasTotal,
- token: tokenBalance
- };
- }
-
- // Otherwise, substract the gas estimate
- const availableEth = this.getTokenBalance(ETH_TOKEN);
- const totalEthValue = availableEth.gt(gasTotal)
- ? availableEth.minus(gasTotal)
- : new BigNumber(0);
-
- return {
- eth: totalEthValue.plus(gasTotal),
- token: totalEthValue
- };
- }
-
- getFormattedTokenValue (tokenValue) {
- return this.getTokenValue(this.token, tokenValue, true);
- }
-
- @action recalculate = (redo = false) => {
- const { account } = this;
-
- if (!account || !this.balance) {
- return;
- }
-
- const balance = this.getBalance();
-
- if (!balance) {
- return;
- }
-
- const gasTotal = new BigNumber(this.gasStore.price || 0).mul(new BigNumber(this.gasStore.gas || 0));
-
- const ethBalance = this.getTokenBalance(ETH_TOKEN, true);
- const tokenBalance = this.getTokenBalance();
- const { eth, token } = this.getValues(gasTotal);
-
- let totalError = null;
- let valueError = null;
-
- if (eth.gt(ethBalance)) {
- totalError = ERRORS.largeAmount;
- }
-
- if (token && token.gt(tokenBalance)) {
- valueError = ERRORS.largeAmount;
- }
-
- log.debug('@recalculate', {
- eth: eth.toFormat(),
- token: token.toFormat(),
- ethBalance: ethBalance.toFormat(),
- tokenBalance: tokenBalance.toFormat(),
- gasTotal: gasTotal.toFormat()
- });
-
- transaction(() => {
- this.totalError = totalError;
- this.valueError = valueError;
- this.gasStore.setErrorTotal(totalError);
- this.gasStore.setEthValue(eth.sub(gasTotal));
-
- this.total = this.api.util.fromWei(eth).toFixed();
-
- const nextValue = this.getFormattedTokenValue(token);
- let prevValue;
-
- try {
- prevValue = new BigNumber(this.value || 0);
- } catch (error) {
- prevValue = new BigNumber(0);
- }
-
- // Change the input only if necessary
- if (!nextValue.eq(prevValue)) {
- this.value = nextValue.toString();
- }
-
- // Re Calculate gas once more to be sure
- if (redo) {
- return this.recalculateGas(false);
- }
- });
- }
-
- send () {
- const { options, values } = this._getTransferParams();
-
- log.debug('@send', 'transfer value', options.value && options.value.toFormat());
-
- return this._getTransferMethod().postTransaction(options, values);
- }
-
- _estimateGas (forceToken = false) {
- const { options, values } = this._getTransferParams(true, forceToken);
-
- return this._getTransferMethod(true, forceToken).estimateGas(options, values);
- }
-
- estimateGas () {
- return this._estimateGas();
- }
-
- _getTransferMethod (gas = false, forceToken = false) {
- const { isEth, isWallet } = this;
-
- if (isEth && !isWallet && !forceToken) {
- return gas ? this.api.eth : this.api.parity;
- }
-
- if (isWallet && !forceToken) {
- return this.wallet.instance.execute;
- }
-
- return this.tokenContract.at(this.token.address).instance.transfer;
- }
-
- _getData (gas = false) {
- const { isEth, isWallet } = this;
-
- if (!isWallet || isEth) {
- return this.data && this.data.length ? this.data : '';
- }
-
- const func = this._getTransferMethod(gas, true);
- const { options, values } = this._getTransferParams(gas, true);
-
- return this.tokenContract.at(this.token.address).getCallData(func, options, values);
- }
-
- _getTransferParams (gas = false, forceToken = false) {
- const { isEth, isWallet } = this;
-
- const to = (isEth && !isWallet) ? this.recipient
- : (this.isWallet ? this.wallet.address : this.token.address);
-
- const options = this.gasStore.overrideTransaction({
- from: this.sender || this.account.address,
- to
- });
-
- if (gas) {
- options.gas = MAX_GAS_ESTIMATION;
- }
-
- const gasTotal = new BigNumber(options.gas || DEFAULT_GAS).mul(options.gasPrice || DEFAULT_GASPRICE);
- const { token } = this.getValues(gasTotal);
-
- if (isEth && !isWallet && !forceToken) {
- options.value = token;
- options.data = this._getData(gas);
-
- return { options, values: [] };
- }
-
- if (isWallet && !forceToken) {
- const to = isEth ? this.recipient : this.token.address;
- const value = isEth ? token : new BigNumber(0);
-
- const values = [
- to, value,
- this._getData(gas)
- ];
-
- return { options, values };
- }
-
- const values = [
- this.recipient,
- token.toFixed(0)
- ];
-
- return { options, values };
- }
-
- _validatePositiveNumber (num) {
- try {
- const v = new BigNumber(num);
-
- if (v.lt(0)) {
- return ERRORS.invalidAmount;
- }
- } catch (e) {
- return ERRORS.invalidAmount;
- }
-
- return null;
- }
-
- _validateDecimals (num) {
- const s = new BigNumber(num).mul(this.token.format || 1).toFixed();
-
- if (s.indexOf('.') !== -1) {
- return ERRORS.invalidDecimals;
- }
-
- return null;
- }
-}
diff --git a/js/packages/dapp-account/Transfer/transfer.css b/js/packages/dapp-account/Transfer/transfer.css
deleted file mode 100644
index a59f5e261..000000000
--- a/js/packages/dapp-account/Transfer/transfer.css
+++ /dev/null
@@ -1,170 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.columns {
- display: flex;
- position: relative;
- flex-wrap: wrap;
-
- &>div {
- flex: 0 1 50%;
- position: relative;
- width: 50%;
- }
-}
-
-.gaseditor {
- margin-top: 1em;
-}
-
-.info {
- line-height: 1.618em;
- width: 100%;
-}
-
-.row {
- display: flex;
- flex-direction: column;
- flex-wrap: wrap;
- position: relative;
-}
-
-.floatbutton {
- float: right;
- margin-left: -100%;
- margin-top: 28px;
- text-align: right;
-
- &>div {
- margin-right: 0.5em;
- }
-}
-
-.token {
- height: 32px;
- padding: 4px 0;
-
- img {
- height: 32px;
- width: 32px;
- margin: 0 16px 0 0;
- z-index: 10;
- }
-
- div {
- height: 32px;
- line-height: 32px;
- display: inline-block;
- vertical-align: top;
- }
-}
-
-.tokenSelect {
- .token {
- margin-top: 10px;
- }
-}
-
-.tokenbalance {
- display: inline-block;
- color: #aaa;
- padding-left: 1em;
-}
-
-.tokenname {}
-
-.address {
- position: relative;
-}
-
-.from {
- padding: 25px 0 0 48px !important;
- line-height: 32px;
-}
-
-.fromaddress {
- text-transform: uppercase;
- display: inline-block;
-}
-
-.frombalance {
- display: inline-block;
- color: #aaa;
- padding-left: 1em;
-}
-
-.icon {
- position: absolute;
- top: 35px;
-}
-
-.grayscale {
- -webkit-filter: grayscale(1);
- filter: grayscale(1);
- opacity: 0;
-}
-
-.hdraccount {
- padding: 1em 0 0 0;
-}
-
-.hdrimage {
- display: inline-block;
-}
-
-.hdrdetails {
- display: inline-block;
-}
-
-.hdrname {
- text-transform: uppercase;
-}
-
-.hdraddress {
- color: #aaa;
- font-size: 0.75em;
-}
-
-.inputContainer {
- padding-top: 10px;
-}
-
-.totalAmount {
- padding-top: 6px;
- font-size: 18px;
- display: flex;
- align-items: center;
- justify-content: space-between;
-}
-
-.totalTx {
- padding-top: 10px;
-}
-
-.contentTitle {
- font-size: 1.2rem;
-}
-
-.warning {
- border-radius: 0.5em;
- background: #f80;
- color: white;
- font-size: 0.75em;
- margin-bottom: 1em;
- padding: 0.75em;
- text-align: center;
-}
diff --git a/js/packages/dapp-account/Transfer/transfer.js b/js/packages/dapp-account/Transfer/transfer.js
deleted file mode 100644
index dd5d80414..000000000
--- a/js/packages/dapp-account/Transfer/transfer.js
+++ /dev/null
@@ -1,314 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-import { connect } from 'react-redux';
-import { bindActionCreators } from 'redux';
-import { observer } from 'mobx-react';
-import { pick } from 'lodash';
-
-import { nullableProptype } from '@parity/shared/util/proptypes';
-import { Button, IdentityIcon, Portal, Warning } from '@parity/ui';
-import { newError } from '@parity/ui/Errors/actions';
-import { CancelIcon, NextIcon, PrevIcon } from '@parity/ui/Icons';
-
-import Details from './Details';
-import Extras from './Extras';
-
-import TransferStore, { WALLET_WARNING_SPENT_TODAY_LIMIT } from './store';
-import styles from './transfer.css';
-
-const STEP_DETAILS = 0;
-const STEP_EXTRA = 1;
-
-@observer
-class Transfer extends Component {
- static contextTypes = {
- api: PropTypes.object.isRequired
- }
-
- static propTypes = {
- newError: PropTypes.func.isRequired,
- gasLimit: PropTypes.object.isRequired,
-
- account: PropTypes.object,
- balance: PropTypes.object,
- onClose: PropTypes.func,
- senders: nullableProptype(PropTypes.object),
- sendersBalances: nullableProptype(PropTypes.object),
- tokens: PropTypes.object,
- wallet: PropTypes.object
- }
-
- store = new TransferStore(this.context.api, this.props);
-
- render () {
- const { stage, steps } = this.store;
-
- return (
-
- { this.renderExceptionWarning() }
- { this.renderWalletWarning() }
- { this.renderPage() }
-
- );
- }
-
- renderExceptionWarning () {
- const { errorEstimated } = this.store.gasStore;
-
- if (!errorEstimated) {
- return null;
- }
-
- return (
-
- );
- }
-
- renderWalletWarning () {
- const { walletWarning } = this.store;
-
- if (!walletWarning) {
- return null;
- }
-
- if (walletWarning === WALLET_WARNING_SPENT_TODAY_LIMIT) {
- const warning = (
-
- );
-
- return (
-
- );
- }
-
- return null;
- }
-
- renderAccount () {
- const { account } = this.props;
-
- return (
-
-
-
-
-
-
- { account.name || 'Unnamed' }
-
-
- { account.address }
-
-
-
- );
- }
-
- renderPage () {
- const { extras, stage } = this.store;
-
- if (stage === STEP_DETAILS) {
- return this.renderDetailsPage();
- } else if (stage === STEP_EXTRA && extras) {
- return this.renderExtrasPage();
- }
- }
-
- renderDetailsPage () {
- const { account, balance, senders } = this.props;
- const { recipient, recipientError, sender, senderError } = this.store;
- const { valueAll, extras, token, total, totalError, value, valueError } = this.store;
-
- return (
-
- );
- }
-
- renderExtrasPage () {
- if (!this.store.gasStore.histogram) {
- return null;
- }
-
- const { isEth, data, dataError, total, totalError } = this.store;
-
- return (
-
- );
- }
-
- renderDialogActions () {
- const { account } = this.props;
- const { extras, sending, stage } = this.store;
-
- const cancelBtn = (
- }
- key='cancel'
- label={
-
- }
- onClick={ this.handleClose }
- />
- );
- const nextBtn = (
- }
- key='next'
- label={
-
- }
- onClick={ this.store.onNext }
- />
- );
- const prevBtn = (
- }
- key='back'
- label={
-
- }
- onClick={ this.store.onPrev }
- />
- );
- const sendBtn = (
-
- }
- key='send'
- label={
-
- }
- onClick={ this.store.onSend }
- />
- );
-
- switch (stage) {
- case 0:
- return extras
- ? [cancelBtn, nextBtn]
- : [cancelBtn, sendBtn];
- case 1:
- return [cancelBtn, prevBtn, sendBtn];
- default:
- return [cancelBtn];
- }
- }
-
- handleClose = () => {
- this.store.handleClose();
- }
-}
-
-function mapStateToProps (initState, initProps) {
- const { tokens } = initState;
- const { address } = initProps.account;
-
- const isWallet = initProps.account && initProps.account.wallet;
- const wallet = isWallet
- ? initState.wallet.wallets[address]
- : null;
-
- const senders = isWallet
- ? Object
- .values(initState.personal.accounts)
- .filter((account) => wallet.owners.includes(account.address))
- .reduce((accounts, account) => {
- accounts[account.address] = account;
- return accounts;
- }, {})
- : null;
-
- return (state) => {
- const { gasLimit } = state.nodeStatus;
- const { balances } = state;
-
- const balance = balances[address];
- const sendersBalances = senders ? pick(balances, Object.keys(senders)) : null;
-
- return { balance, gasLimit, senders, sendersBalances, tokens, wallet };
- };
-}
-
-function mapDispatchToProps (dispatch) {
- return bindActionCreators({
- newError
- }, dispatch);
-}
-
-export default connect(
- mapStateToProps,
- mapDispatchToProps
-)(Transfer);
diff --git a/js/packages/dapp-account/Verification/Done/done.css b/js/packages/dapp-account/Verification/Done/done.css
deleted file mode 100644
index 700a0549a..000000000
--- a/js/packages/dapp-account/Verification/Done/done.css
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-.spacing {
- margin-top: 1.5em;
-}
-
-.container {
- margin-top: .5em;
- display: flex;
- align-items: center;
-}
-
-.message {
- margin-top: 0;
- margin-bottom: 0;
- margin-left: .5em;
-}
diff --git a/js/packages/dapp-account/Verification/Done/done.js b/js/packages/dapp-account/Verification/Done/done.js
deleted file mode 100644
index 15e44178d..000000000
--- a/js/packages/dapp-account/Verification/Done/done.js
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import { FormattedMessage } from 'react-intl';
-
-import { DoneIcon } from '@parity/ui/Icons';
-
-import styles from './done.css';
-
-export default class Done extends Component {
- render () {
- return (
-
-
-
-
-
-
- );
- }
-}
diff --git a/js/packages/dapp-account/Verification/Done/index.js b/js/packages/dapp-account/Verification/Done/index.js
deleted file mode 100644
index 547e2084f..000000000
--- a/js/packages/dapp-account/Verification/Done/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './done';
diff --git a/js/packages/dapp-account/Verification/GatherData/gatherData.css b/js/packages/dapp-account/Verification/GatherData/gatherData.css
deleted file mode 100644
index 0f9ba3617..000000000
--- a/js/packages/dapp-account/Verification/GatherData/gatherData.css
+++ /dev/null
@@ -1,49 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.spacing {
- margin-top: 1.5em;
-}
-
-.container {
- margin-top: .5em;
- display: flex;
- align-items: center;
-}
-.message {
- margin-top: 0;
- margin-bottom: 0;
- margin-left: .5em;
-}
-
-.field {
- margin-bottom: .5em;
-}
-
-.terms {
- line-height: 1.3;
- opacity: .7;
-
- ul {
- padding-left: 1.5em;
- }
-
- li {
- margin-top: .2em;
- margin-bottom: .2em;
- }
-}
diff --git a/js/packages/dapp-account/Verification/GatherData/gatherData.js b/js/packages/dapp-account/Verification/GatherData/gatherData.js
deleted file mode 100644
index 504e8fcfc..000000000
--- a/js/packages/dapp-account/Verification/GatherData/gatherData.js
+++ /dev/null
@@ -1,291 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-import BigNumber from 'bignumber.js';
-
-import { fromWei } from '@parity/api/util/wei';
-import { Checkbox, Form, Input } from '@parity/ui';
-import { DoneIcon, ErrorIcon, InfoIcon } from '@parity/ui/Icons';
-import { nullableProptype } from '@parity/shared/util/proptypes';
-
-import smsTermsOfService from '../sms-verification/terms-of-service';
-import emailTermsOfService from '../email-verification/terms-of-service';
-import { howSMSVerificationWorks, howEmailVerificationWorks } from '../how-it-works';
-
-import styles from './gatherData.css';
-
-const boolOfError = PropTypes.oneOfType([ PropTypes.bool, PropTypes.instanceOf(Error) ]);
-
-export default class GatherData extends Component {
- static propTypes = {
- fee: React.PropTypes.instanceOf(BigNumber),
- fields: PropTypes.array.isRequired,
- accountHasRequested: nullableProptype(PropTypes.bool.isRequired),
- isServerRunning: nullableProptype(PropTypes.bool.isRequired),
- isAbleToRequest: nullableProptype(boolOfError.isRequired),
- accountIsVerified: nullableProptype(PropTypes.bool.isRequired),
- method: PropTypes.string.isRequired,
- setConsentGiven: PropTypes.func.isRequired
- }
-
- render () {
- const { method, accountIsVerified } = this.props;
- const termsOfService = method === 'email' ? emailTermsOfService : smsTermsOfService;
- const howItWorks = method === 'email' ? howEmailVerificationWorks : howSMSVerificationWorks;
-
- return (
-
- );
- }
-
- renderServerRunning () {
- const { isServerRunning } = this.props;
-
- if (isServerRunning) {
- return (
-
);
- }
-
- renderIfAbleToRequest () {
- const { accountIsVerified, isAbleToRequest } = this.props;
-
- // If the account is verified, don't show a warning.
- // If the client is able to send the request, don't show a warning
- if (accountIsVerified || isAbleToRequest === true) {
- return null;
- }
-
- if (isAbleToRequest === null) {
- return (
-
-
-
- );
- } else if (isAbleToRequest) {
- return (
-
-
-
- { isAbleToRequest.message }
-
-
- );
- }
- }
-
- consentOnChange = (_, consentGiven) => {
- this.props.setConsentGiven(consentGiven);
- }
-}
diff --git a/js/packages/dapp-account/Verification/GatherData/index.js b/js/packages/dapp-account/Verification/GatherData/index.js
deleted file mode 100644
index 403886099..000000000
--- a/js/packages/dapp-account/Verification/GatherData/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './gatherData';
diff --git a/js/packages/dapp-account/Verification/QueryCode/index.js b/js/packages/dapp-account/Verification/QueryCode/index.js
deleted file mode 100644
index 77af76850..000000000
--- a/js/packages/dapp-account/Verification/QueryCode/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './queryCode';
diff --git a/js/packages/dapp-account/Verification/QueryCode/queryCode.js b/js/packages/dapp-account/Verification/QueryCode/queryCode.js
deleted file mode 100644
index f4d8ca563..000000000
--- a/js/packages/dapp-account/Verification/QueryCode/queryCode.js
+++ /dev/null
@@ -1,88 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-
-import { nodeOrStringProptype } from '@parity/shared/util/proptypes';
-import { Form, Input } from '@parity/ui';
-
-export default class QueryCode extends Component {
- static propTypes = {
- receiver: PropTypes.string.isRequired,
- hint: nodeOrStringProptype(),
- isCodeValid: PropTypes.bool.isRequired,
- setCode: PropTypes.func.isRequired
- }
-
- static defaultProps = {
- hint: (
-
- )
- }
-
- render () {
- const { receiver, hint, isCodeValid } = this.props;
-
- return (
-
- );
- }
-
- onChange = (_, code) => {
- this.props.setCode(code.trim());
- }
-
- onSubmit = (code) => {
- this.props.setCode(code.trim());
- }
-}
diff --git a/js/packages/dapp-account/Verification/SendConfirmation/index.js b/js/packages/dapp-account/Verification/SendConfirmation/index.js
deleted file mode 100644
index a6277a4d4..000000000
--- a/js/packages/dapp-account/Verification/SendConfirmation/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './sendConfirmation';
diff --git a/js/packages/dapp-account/Verification/SendConfirmation/sendConfirmation.css b/js/packages/dapp-account/Verification/SendConfirmation/sendConfirmation.css
deleted file mode 100644
index 8b8a28bed..000000000
--- a/js/packages/dapp-account/Verification/SendConfirmation/sendConfirmation.css
+++ /dev/null
@@ -1,20 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.centered {
- text-align: center;
-}
diff --git a/js/packages/dapp-account/Verification/SendConfirmation/sendConfirmation.js b/js/packages/dapp-account/Verification/SendConfirmation/sendConfirmation.js
deleted file mode 100644
index c7efd3021..000000000
--- a/js/packages/dapp-account/Verification/SendConfirmation/sendConfirmation.js
+++ /dev/null
@@ -1,66 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-
-import { nullableProptype } from '@parity/shared/util/proptypes';
-import TxHash from '@parity/ui/TxHash';
-
-import { POSTING_CONFIRMATION, POSTED_CONFIRMATION } from '../store';
-
-import styles from './sendConfirmation.css';
-
-export default class SendConfirmation extends Component {
- static propTypes = {
- step: PropTypes.any.isRequired,
- tx: nullableProptype(PropTypes.any.isRequired)
- }
-
- render () {
- const { step, tx } = this.props;
-
- if (step === POSTING_CONFIRMATION) {
- return (
-
- );
- }
-
- return null;
- }
-}
diff --git a/js/packages/dapp-account/Verification/SendRequest/index.js b/js/packages/dapp-account/Verification/SendRequest/index.js
deleted file mode 100644
index 998cdd02c..000000000
--- a/js/packages/dapp-account/Verification/SendRequest/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './sendRequest';
diff --git a/js/packages/dapp-account/Verification/SendRequest/sendRequest.css b/js/packages/dapp-account/Verification/SendRequest/sendRequest.css
deleted file mode 100644
index 8b8a28bed..000000000
--- a/js/packages/dapp-account/Verification/SendRequest/sendRequest.css
+++ /dev/null
@@ -1,20 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.centered {
- text-align: center;
-}
diff --git a/js/packages/dapp-account/Verification/SendRequest/sendRequest.js b/js/packages/dapp-account/Verification/SendRequest/sendRequest.js
deleted file mode 100644
index 0bf55ab55..000000000
--- a/js/packages/dapp-account/Verification/SendRequest/sendRequest.js
+++ /dev/null
@@ -1,78 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-
-import { nullableProptype } from '@parity/shared/util/proptypes';
-import TxHash from '@parity/ui/TxHash';
-
-import { POSTING_REQUEST, POSTED_REQUEST, REQUESTING_CODE } from '../store';
-
-import styles from './sendRequest.css';
-
-export default class SendRequest extends Component {
- static propTypes = {
- step: PropTypes.any.isRequired,
- tx: nullableProptype(PropTypes.any.isRequired)
- }
-
- render () {
- const { step, tx } = this.props;
-
- switch (step) {
- case POSTING_REQUEST:
- return (
-
-
-
- );
-
- case POSTED_REQUEST:
- return (
-
-
-
-
-
-
- );
-
- case REQUESTING_CODE:
- return (
-
-
-
- );
-
- default:
- return null;
- }
- }
-}
diff --git a/js/packages/dapp-account/Verification/email-store.js b/js/packages/dapp-account/Verification/email-store.js
deleted file mode 100644
index be36d497c..000000000
--- a/js/packages/dapp-account/Verification/email-store.js
+++ /dev/null
@@ -1,131 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { observable, computed, action } from 'mobx';
-
-import { bytesToHex } from '@parity/api/util/format';
-import { sha3 } from '@parity/api/util/sha3';
-import EmailVerificationABI from '@parity/shared/contracts/abi/email-verification.json';
-
-import VerificationStore, {
- LOADING, QUERY_DATA, QUERY_CODE, POSTED_CONFIRMATION, DONE
-} from './store';
-import { isServerRunning, hasReceivedCode, postToServer } from './email-verification';
-
-const ZERO20 = '0x0000000000000000000000000000000000000000';
-
-// name in the `BadgeReg.sol` contract
-const EMAIL_VERIFICATION = 'emailverification';
-
-export default class EmailVerificationStore extends VerificationStore {
- @observable email = '';
-
- @computed get isEmailValid () {
- // See https://davidcel.is/posts/stop-validating-email-addresses-with-regex/
- return this.email && this.email.indexOf('@') >= 0;
- }
-
- @computed get isStepValid () {
- if (this.step === DONE) {
- return true;
- }
- if (this.error) {
- return false;
- }
-
- switch (this.step) {
- case LOADING:
- return this.contract && this.fee && this.accountIsVerified !== null && this.accountHasRequested !== null;
- case QUERY_DATA:
- return this.isEmailValid && this.consentGiven && this.isAbleToRequest === true;
- case QUERY_CODE:
- return this.requestTx && this.isCodeValid === true;
- case POSTED_CONFIRMATION:
- return !!this.confirmationTx;
- default:
- return false;
- }
- }
-
- constructor (api, account, isTestnet) {
- super(api, EmailVerificationABI, EMAIL_VERIFICATION, account, isTestnet);
- }
-
- isServerRunning = () => {
- return isServerRunning(this.isTestnet);
- }
-
- checkIfReceivedCode = () => {
- return hasReceivedCode(this.email, this.account, this.isTestnet);
- }
-
- // If the email has already been used for verification of another account,
- // we prevent the user from wasting ETH to request another verification.
- @action setIfAbleToRequest = () => {
- const { isEmailValid } = this;
-
- if (!isEmailValid) {
- this.isAbleToRequest = true;
- return;
- }
-
- const { contract, email } = this;
- const emailHash = sha3.text(email);
-
- this.isAbleToRequest = null;
- contract
- .instance.reverse
- .call({}, [ emailHash ])
- .then((address) => {
- if (address === ZERO20) {
- this.isAbleToRequest = true;
- } else {
- this.isAbleToRequest = new Error('Another account has been verified using this e-mail.');
- }
- })
- .catch((err) => {
- this.error = 'Failed to check if able to send request: ' + err.message;
- });
- }
-
- // Determine the values relevant for checking if the last request contains
- // the same data as the current one.
- requestValues = () => [ sha3.text(this.email) ]
-
- shallSkipRequest = (currentValues) => {
- const { accountHasRequested } = this;
- const lastRequest = this.lastRequestValues;
-
- if (!accountHasRequested) {
- return Promise.resolve(false);
- }
- // If the last email verification `request` for the selected address contains
- // the same email as the current one, don't send another request to save ETH.
- const skip = currentValues[0] === bytesToHex(lastRequest.emailHash.value);
-
- return Promise.resolve(skip);
- }
-
- @action setEmail = (email) => {
- this.email = email;
- }
-
- requestCode = () => {
- const { email, account, isTestnet } = this;
-
- return postToServer({ email, address: account }, isTestnet);
- }
-}
diff --git a/js/packages/dapp-account/Verification/email-verification/index.js b/js/packages/dapp-account/Verification/email-verification/index.js
deleted file mode 100644
index 9e79547ec..000000000
--- a/js/packages/dapp-account/Verification/email-verification/index.js
+++ /dev/null
@@ -1,68 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { stringify } from 'querystring';
-
-export const isServerRunning = (isTestnet = false) => {
- const port = isTestnet ? 28443 : 18443;
-
- return fetch(`https://email-verification.parity.io:${port}/health`, {
- mode: 'cors',
- cache: 'no-store'
- })
- .then((res) => {
- return res.ok;
- })
- .catch(() => {
- return false;
- });
-};
-
-export const hasReceivedCode = (email, address, isTestnet = false) => {
- const port = isTestnet ? 28443 : 18443;
- const query = stringify({ email, address });
-
- return fetch(`https://email-verification.parity.io:${port}/?${query}`, {
- mode: 'cors',
- cache: 'no-store'
- })
- .then((res) => {
- return res.ok;
- })
- .catch(() => {
- return false; // todo: check for 404
- });
-};
-
-export const postToServer = (query, isTestnet = false) => {
- const port = isTestnet ? 28443 : 18443;
-
- query = stringify(query);
-
- return fetch(`https://email-verification.parity.io:${port}/?${query}`, {
- method: 'POST',
- mode: 'cors',
- cache: 'no-store'
- })
- .then((res) => {
- return res.json().then((data) => {
- if (res.ok) {
- return data.message;
- }
- throw new Error(data.message || 'unknown error');
- });
- });
-};
diff --git a/js/packages/dapp-account/Verification/email-verification/terms-of-service.js b/js/packages/dapp-account/Verification/email-verification/terms-of-service.js
deleted file mode 100644
index 8826be032..000000000
--- a/js/packages/dapp-account/Verification/email-verification/terms-of-service.js
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React from 'react';
-
-export default (
-
-
This privacy notice relates to your use of the Parity email verification service. We take your privacy seriously and deal in an honest, direct and transparent way when it comes to your data.
-
We collect your email address when you use this service. This is temporarily kept in memory, and then encrypted and stored in our EU servers. We only retain the cryptographic hash of the email address to prevent duplicated accounts. The cryptographic hash of your email address is also stored on the blockchain which is public by design. You consent to this use.
-
You pay a fee for the cost of this service using the account you want to verify.
-
Your email address is transmitted to a third party EU email verification service mailjet for the sole purpose of the email verification. You consent to this use. Mailjet's privacy policy is here: https://www.mailjet.com/privacy-policy.
-
Parity Technology Limited is registered in England and Wales under company number 09760015 and complies with the Data Protection Act 1998 (UK). You may contact us via email at admin@parity.io. Our general privacy policy can be found here: https://parity.io/legal.html.
-
-);
diff --git a/js/packages/dapp-account/Verification/how-it-works.js b/js/packages/dapp-account/Verification/how-it-works.js
deleted file mode 100644
index aadbe48f1..000000000
--- a/js/packages/dapp-account/Verification/how-it-works.js
+++ /dev/null
@@ -1,41 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React from 'react';
-
-import styles from './verification.css';
-
-export const howSMSVerificationWorks = (
-
-
The following steps will let you prove that you control both an account and a phone number.
-
-
You send a verification request to a specific contract.
-
Our server puts a puzzle into this contract.
-
The code you receive via SMS is the solution to this puzzle.
The following steps will let you prove that you control both an account and an e-mail address.
-
-
You send a verification request to a specific contract.
-
Our server puts a puzzle into this contract.
-
The code you receive via e-mail is the solution to this puzzle.
-
-
-);
diff --git a/js/packages/dapp-account/Verification/index.js b/js/packages/dapp-account/Verification/index.js
deleted file mode 100644
index 69231b853..000000000
--- a/js/packages/dapp-account/Verification/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './verification';
diff --git a/js/packages/dapp-account/Verification/sms-store.js b/js/packages/dapp-account/Verification/sms-store.js
deleted file mode 100644
index 5fef56315..000000000
--- a/js/packages/dapp-account/Verification/sms-store.js
+++ /dev/null
@@ -1,90 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { observable, computed, action } from 'mobx';
-import phone from 'phoneformat.js';
-
-import SMSVerificationABI from '@parity/shared/contracts/abi/sms-verification.json';
-
-import VerificationStore, { LOADING, QUERY_DATA, QUERY_CODE, POSTED_CONFIRMATION, DONE } from './store';
-import { isServerRunning, hasReceivedCode, postToServer } from './sms-verification';
-
-// name in the `BadgeReg.sol` contract
-const SMS_VERIFICATION = 'smsverification';
-
-export default class SMSVerificationStore extends VerificationStore {
- @observable number = '';
-
- @computed get isNumberValid () {
- return phone.isValidNumber(this.number);
- }
-
- @computed get isStepValid () {
- if (this.step === DONE) {
- return true;
- }
- if (this.error) {
- return false;
- }
-
- switch (this.step) {
- case LOADING:
- return this.contract && this.fee && this.accountIsVerified !== null && this.accountHasRequested !== null;
- case QUERY_DATA:
- return this.isNumberValid && this.consentGiven;
- case QUERY_CODE:
- return this.requestTx && this.isCodeValid === true;
- case POSTED_CONFIRMATION:
- return !!this.confirmationTx;
- default:
- return false;
- }
- }
-
- constructor (api, account, isTestnet) {
- super(api, SMSVerificationABI, SMS_VERIFICATION, account, isTestnet);
- }
-
- isServerRunning = () => {
- return isServerRunning(this.isTestnet);
- }
-
- checkIfReceivedCode = () => {
- return hasReceivedCode(this.number, this.account, this.isTestnet);
- }
-
- // SMS verification events don't contain the phone number, so we will have to
- // send a new request every single time. See below.
- @action setIfAbleToRequest = () => {
- this.isAbleToRequest = true;
- }
-
- // SMS verification `request` & `confirm` transactions and events don't contain the
- // phone number, so we will have to send a new request every single time. This may
- // cost the user more money, but given that it fails otherwise, it seems like a
- // reasonable tradeoff.
- shallSkipRequest = () => Promise.resolve(false)
-
- @action setNumber = (number) => {
- this.number = number;
- }
-
- requestCode = () => {
- const { number, account, isTestnet } = this;
-
- return postToServer({ number, address: account }, isTestnet);
- }
-}
diff --git a/js/packages/dapp-account/Verification/sms-verification/index.js b/js/packages/dapp-account/Verification/sms-verification/index.js
deleted file mode 100644
index 79cbf13d2..000000000
--- a/js/packages/dapp-account/Verification/sms-verification/index.js
+++ /dev/null
@@ -1,68 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { stringify } from 'querystring';
-
-export const isServerRunning = (isTestnet = false) => {
- const port = isTestnet ? 8443 : 443;
-
- return fetch(`https://sms-verification.parity.io:${port}/health`, {
- mode: 'cors',
- cache: 'no-store'
- })
- .then((res) => {
- return res.ok;
- })
- .catch(() => {
- return false;
- });
-};
-
-export const hasReceivedCode = (number, address, isTestnet = false) => {
- const port = isTestnet ? 8443 : 443;
- const query = stringify({ number, address });
-
- return fetch(`https://sms-verification.parity.io:${port}/?${query}`, {
- mode: 'cors',
- cache: 'no-store'
- })
- .then((res) => {
- return res.ok;
- })
- .catch(() => {
- return false; // todo: check for 404
- });
-};
-
-export const postToServer = (query, isTestnet = false) => {
- const port = isTestnet ? 8443 : 443;
-
- query = stringify(query);
-
- return fetch(`https://sms-verification.parity.io:${port}/?${query}`, {
- method: 'POST',
- mode: 'cors',
- cache: 'no-store'
- })
- .then((res) => {
- return res.json().then((data) => {
- if (res.ok) {
- return data.message;
- }
- throw new Error(data.message || 'unknown error');
- });
- });
-};
diff --git a/js/packages/dapp-account/Verification/sms-verification/terms-of-service.js b/js/packages/dapp-account/Verification/sms-verification/terms-of-service.js
deleted file mode 100644
index 9451a382b..000000000
--- a/js/packages/dapp-account/Verification/sms-verification/terms-of-service.js
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React from 'react';
-
-export default (
-
-
This privacy notice relates to your use of the Parity SMS verification service. We take your privacy seriously and deal in an honest, direct and transparent way when it comes to your data.
-
We collect your phone number when you use this service. This is temporarily kept in memory, and then encrypted and stored in our EU servers. We only retain the cryptographic hash of the number to prevent duplicated accounts. You consent to this use.
-
You pay a fee for the cost of this service using the account you want to verify.
-
Your phone number is transmitted to a third party US SMS verification service Twilio for the sole purpose of the SMS verification. You consent to this use. Twilio’s privacy policy is here: https://www.twilio.com/legal/privacy/developer.
-
Parity Technology Limited is registered in England and Wales under company number 09760015 and complies with the Data Protection Act 1998 (UK). You may contact us via email at admin@parity.io. Our general privacy policy can be found here: https://parity.io/legal.html.
-
-);
diff --git a/js/packages/dapp-account/Verification/store.js b/js/packages/dapp-account/Verification/store.js
deleted file mode 100644
index 50bcbe2c0..000000000
--- a/js/packages/dapp-account/Verification/store.js
+++ /dev/null
@@ -1,263 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { observable, autorun, action } from 'mobx';
-
-import Contract from '@parity/api/contract';
-import { sha3 } from '@parity/api/util/sha3';
-import Contracts from '@parity/shared/contracts';
-import { checkIfVerified, findLastRequested, awaitPuzzle } from '@parity/shared/contracts/verification';
-import { checkIfTxFailed, waitForConfirmations } from '@parity/shared/util/tx';
-
-export const LOADING = 'fetching-contract';
-export const QUERY_DATA = 'query-data';
-export const POSTING_REQUEST = 'posting-request';
-export const POSTED_REQUEST = 'posted-request';
-export const REQUESTING_CODE = 'requesting-code';
-export const QUERY_CODE = 'query-code';
-export const POSTING_CONFIRMATION = 'posting-confirmation';
-export const POSTED_CONFIRMATION = 'posted-confirmation';
-export const DONE = 'done';
-
-export default class VerificationStore {
- @observable step = null;
- @observable error = null;
-
- @observable contract = null;
- @observable fee = null;
- @observable accountIsVerified = null;
- @observable accountHasRequested = null;
- @observable isAbleToRequest = null;
- @observable lastRequestValues = null;
- @observable isServerRunning = null;
- @observable consentGiven = false;
- @observable requestTx = null;
- @observable code = '';
- @observable isCodeValid = false;
- @observable confirmationTx = null;
-
- constructor (api, abi, certifierName, account, isTestnet) {
- this._api = api;
- this.account = account;
- this.isTestnet = isTestnet;
-
- this.step = LOADING;
- Contracts.get(this._api).badgeReg.fetchCertifierByName(certifierName)
- .then(({ address }) => {
- this.contract = new Contract(api, abi).at(address);
- this.load();
- })
- .catch((err) => {
- console.error('error', err);
- this.error = 'Failed to fetch the contract: ' + err.message;
- });
-
- autorun(() => {
- if (this.error) {
- console.error('verification: ' + this.error);
- }
- });
-
- autorun(() => {
- if (this.step !== QUERY_DATA) {
- return;
- }
-
- this.setIfAbleToRequest();
- });
- }
-
- @action load = () => {
- const { contract, account } = this;
-
- this.step = LOADING;
-
- const isServerRunning = this.isServerRunning()
- .then((isRunning) => {
- this.isServerRunning = isRunning;
- })
- .catch((err) => {
- this.error = 'Failed to check if server is running: ' + err.message;
- });
-
- const fee = contract.instance.fee.call()
- .then((fee) => {
- this.fee = fee;
- })
- .catch((err) => {
- this.error = 'Failed to fetch the fee: ' + err.message;
- });
-
- const accountIsVerified = checkIfVerified(contract, account)
- .then((accountIsVerified) => {
- this.accountIsVerified = accountIsVerified;
- })
- .catch((err) => {
- this.error = 'Failed to check if verified: ' + err.message;
- });
-
- const accountHasRequested = findLastRequested(contract, account)
- .then((log) => {
- this.accountHasRequested = !!log;
- if (log) {
- this.lastRequestValues = log.params;
- this.requestTx = log.transactionHash;
- }
- })
- .catch((err) => {
- this.error = 'Failed to check if requested: ' + err.message;
- });
-
- Promise
- .all([ isServerRunning, fee, accountIsVerified, accountHasRequested ])
- .then(() => {
- this.step = QUERY_DATA;
- });
- }
-
- @action setConsentGiven = (consentGiven) => {
- this.consentGiven = consentGiven;
- }
-
- @action setCode = (code) => {
- const { contract, account } = this;
-
- if (!contract || !account || code.length === 0) {
- return;
- }
-
- const confirm = contract.functions.find((fn) => fn.name === 'confirm');
- const options = { from: account };
- const values = [ sha3.text(code) ];
-
- this.code = code;
- this.isCodeValid = false;
- confirm.estimateGas(options, values)
- .then((gas) => {
- options.gas = gas.mul(1.2).toFixed(0);
- return confirm.call(options, values);
- })
- .then((result) => {
- this.isCodeValid = result === true;
- })
- .catch((err) => {
- this.error = 'Failed to check if the code is valid: ' + err.message;
- });
- }
-
- requestValues = () => []
-
- @action sendRequest = () => {
- const { api, account, contract, fee } = this;
-
- const request = contract.functions.find((fn) => fn.name === 'request');
- const options = { from: account, value: fee.toString() };
- const values = this.requestValues();
-
- this.shallSkipRequest(values)
- .then((skipRequest) => {
- if (skipRequest) {
- return;
- }
-
- this.step = POSTING_REQUEST;
- return request.estimateGas(options, values)
- .then((gas) => {
- options.gas = gas.mul(1.2).toFixed(0);
- return request.postTransaction(options, values);
- })
- .then((handle) => {
- // The "request rejected" error doesn't have any property to distinguish
- // it from other errors, so we can't give a meaningful error here.
- return api.pollMethod('parity_checkRequest', handle);
- })
- .then((txHash) => {
- this.requestTx = txHash;
- return checkIfTxFailed(api, txHash, options.gas)
- .then((hasFailed) => {
- if (hasFailed) {
- throw new Error('Transaction failed, all gas used up.');
- }
- this.step = POSTED_REQUEST;
- return waitForConfirmations(api, txHash, 1);
- });
- });
- })
- .then(() => this.checkIfReceivedCode())
- .then((hasReceived) => {
- if (hasReceived) {
- return;
- }
-
- this.step = REQUESTING_CODE;
- return this
- .requestCode()
- .then(() => awaitPuzzle(api, contract, account));
- })
- .then(() => {
- this.step = QUERY_CODE;
- })
- .catch((err) => {
- this.error = 'Failed to request a confirmation code: ' + err.message;
- });
- }
-
- @action queryCode = () => {
- this.step = QUERY_CODE;
- }
-
- @action sendConfirmation = () => {
- const { api, account, contract, code } = this;
- const token = sha3.text(code);
-
- const confirm = contract.functions.find((fn) => fn.name === 'confirm');
- const options = { from: account };
- const values = [ token ];
-
- this.step = POSTING_CONFIRMATION;
- confirm.estimateGas(options, values)
- .then((gas) => {
- options.gas = gas.mul(1.2).toFixed(0);
- return confirm.postTransaction(options, values);
- })
- .then((handle) => {
- // TODO: The "request rejected" error doesn't have any property to
- // distinguish it from other errors, so we can't give a meaningful error here.
- return api.pollMethod('parity_checkRequest', handle);
- })
- .then((txHash) => {
- this.confirmationTx = txHash;
- return checkIfTxFailed(api, txHash, options.gas)
- .then((hasFailed) => {
- if (hasFailed) {
- throw new Error('Transaction failed, all gas used up.');
- }
- this.step = POSTED_CONFIRMATION;
- return waitForConfirmations(api, txHash, 1);
- });
- })
- .then(() => {
- this.step = DONE;
- })
- .catch((err) => {
- this.error = 'Failed to send the verification code: ' + err.message;
- });
- }
-
- @action done = () => {
- this.step = DONE;
- }
-}
diff --git a/js/packages/dapp-account/Verification/verification.css b/js/packages/dapp-account/Verification/verification.css
deleted file mode 100644
index 67b2a56c1..000000000
--- a/js/packages/dapp-account/Verification/verification.css
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.noSpacing {
- margin-top: 0;
- margin-bottom: 0;
-}
-
-.list li {
- padding: .1em 0;
-}
diff --git a/js/packages/dapp-account/Verification/verification.js b/js/packages/dapp-account/Verification/verification.js
deleted file mode 100644
index ac876cd04..000000000
--- a/js/packages/dapp-account/Verification/verification.js
+++ /dev/null
@@ -1,449 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-import { connect } from 'react-redux';
-import { observer } from 'mobx-react';
-import { observable } from 'mobx';
-
-import { Button, IdentityIcon, Portal, RadioButtons } from '@parity/ui';
-import { CancelIcon, DoneIcon } from '@parity/ui/Icons';
-
-import SMSVerificationStore from './sms-store';
-import EmailVerificationStore from './email-store';
-
-import styles from './verification.css';
-
-const METHODS = {
- sms: {
- label: (
-
- ),
- key: 'sms',
- value: 'sms',
- description: (
-
-
- }
- label={
-
- }
- onChange={ changePassword }
- value={ accountValue }
- />
-
-
- );
- }
-
- renderFaucetDialog () {
- const { netVersion } = this.props;
-
- if (!this.store.isFaucetVisible) {
- return null;
- }
-
- const { address } = this.props.params;
-
- return (
-
- );
- }
-
- renderFundDialog () {
- if (!this.store.isFundVisible) {
- return null;
- }
-
- const { address } = this.props.params;
-
- return (
-
- );
- }
-
- renderPasswordDialog (account) {
- if (!this.store.isPasswordVisible) {
- return null;
- }
-
- return (
-
- );
- }
-
- renderTransferDialog (account) {
- if (!this.store.isTransferVisible) {
- return null;
- }
-
- return (
-
- );
- }
-
- renderVerificationDialog () {
- if (!this.store.isVerificationVisible) {
- return null;
- }
-
- const { address } = this.props.params;
-
- return (
-
- );
- }
-
- onEnter = (event) => {
- if (event.key === 'Enter') {
- this.onExport();
- }
- }
-
- exportClose = () => {
- const { toggleExportDialog } = this.store;
- const { resetAccountValue } = this.exportStore;
-
- resetAccountValue();
- toggleExportDialog();
- }
-
- onExport = () => {
- const { onExport } = this.exportStore;
-
- onExport(this.hideExport);
- }
-
- hideExport = () => {
- this.store.toggleExportDialog();
- }
-}
-
-function mapStateToProps (state, props) {
- const { address } = props.params;
-
- const { accounts } = state.personal;
- const certifications = state.certifications;
- const { netVersion } = state.nodeStatus;
-
- const account = (accounts || {})[address];
-
- return {
- account,
- accounts,
- certifications,
- netVersion
- };
-}
-
-function mapDispatchToProps (dispatch) {
- return bindActionCreators({
- fetchCertifiers,
- fetchCertifications,
- newError,
- setVisibleAccounts
- }, dispatch);
-}
-
-export default connect(
- mapStateToProps,
- mapDispatchToProps
-)(Account);
diff --git a/js/packages/dapp-account/account.spec.js b/js/packages/dapp-account/account.spec.js
deleted file mode 100644
index 54720889c..000000000
--- a/js/packages/dapp-account/account.spec.js
+++ /dev/null
@@ -1,191 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { shallow } from 'enzyme';
-import React from 'react';
-
-import { ACCOUNTS, ADDRESS, createRedux } from './account.test.js';
-
-import Account from './account';
-
-let component;
-let instance;
-let store;
-
-function render (props) {
- component = shallow(
- ,
- {
- context: {
- store: createRedux()
- }
- }
- ).find('Account').shallow();
- instance = component.instance();
- store = instance.store;
-
- return component;
-}
-
-describe('views/Account', () => {
- describe('rendering', () => {
- beforeEach(() => {
- render();
- });
-
- it('renders defaults', () => {
- expect(component).to.be.ok;
- });
-
- describe('sections', () => {
- it('renders the Actionbar', () => {
- expect(component.find('Actionbar')).to.have.length(1);
- });
-
- it('renders the Page', () => {
- expect(component.find('Page')).to.have.length(1);
- });
-
- it('renders the Header', () => {
- expect(component.find('Header')).to.have.length(1);
- });
-
- it('renders the Transactions', () => {
- expect(component.find('Connect(Transactions)')).to.have.length(1);
- });
-
- it('renders no other sections', () => {
- expect(component.find('div').children()).to.have.length(2);
- });
- });
- });
-
- describe('sub-renderers', () => {
- describe('renderActionBar', () => {
- let bar;
-
- beforeEach(() => {
- render();
-
- bar = instance.renderActionbar({ tokens: {} });
- });
-
- it('renders the bar', () => {
- expect(bar.type).to.match(/Actionbar/);
- });
- });
-
- describe('renderDeleteDialog', () => {
- it('renders null when not visible', () => {
- render();
-
- expect(store.isDeleteVisible).to.be.false;
- expect(instance.renderDeleteDialog(ACCOUNTS[ADDRESS])).to.be.null;
- });
-
- it('renders the modal when visible', () => {
- render();
-
- store.toggleDeleteDialog();
- expect(instance.renderDeleteDialog(ACCOUNTS[ADDRESS]).type).to.match(/Connect/);
- });
- });
-
- describe('renderEditDialog', () => {
- it('renders null when not visible', () => {
- render();
-
- expect(store.isEditVisible).to.be.false;
- expect(instance.renderEditDialog(ACCOUNTS[ADDRESS])).to.be.null;
- });
-
- it('renders the modal when visible', () => {
- render();
-
- store.toggleEditDialog();
- expect(instance.renderEditDialog(ACCOUNTS[ADDRESS]).type).to.match(/Connect/);
- });
- });
-
- describe('renderFundDialog', () => {
- it('renders null when not visible', () => {
- render();
-
- expect(store.isFundVisible).to.be.false;
- expect(instance.renderFundDialog()).to.be.null;
- });
-
- it('renders the modal when visible', () => {
- render();
-
- store.toggleFundDialog();
- expect(instance.renderFundDialog().type).to.match(/Shapeshift/);
- });
- });
-
- describe('renderPasswordDialog', () => {
- it('renders null when not visible', () => {
- render();
-
- expect(store.isPasswordVisible).to.be.false;
- expect(instance.renderPasswordDialog()).to.be.null;
- });
-
- it('renders the modal when visible', () => {
- render();
-
- store.togglePasswordDialog();
- expect(instance.renderPasswordDialog({ address: ADDRESS }).type).to.match(/Connect/);
- });
- });
-
- describe('renderTransferDialog', () => {
- it('renders null when not visible', () => {
- render();
-
- expect(store.isTransferVisible).to.be.false;
- expect(instance.renderTransferDialog()).to.be.null;
- });
-
- it('renders the modal when visible', () => {
- render();
-
- store.toggleTransferDialog();
- expect(instance.renderTransferDialog().type).to.match(/Connect/);
- });
- });
-
- describe('renderVerificationDialog', () => {
- it('renders null when not visible', () => {
- render();
-
- expect(store.isVerificationVisible).to.be.false;
- expect(instance.renderVerificationDialog()).to.be.null;
- });
-
- it('renders the modal when visible', () => {
- render();
-
- store.toggleVerificationDialog();
- expect(instance.renderVerificationDialog().type).to.match(/Connect/);
- });
- });
- });
-});
diff --git a/js/packages/dapp-account/account.test.js b/js/packages/dapp-account/account.test.js
deleted file mode 100644
index b341a7534..000000000
--- a/js/packages/dapp-account/account.test.js
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import sinon from 'sinon';
-
-const ADDRESS = '0x0123456789012345678901234567890123456789';
-const ACCOUNTS = {
- [ADDRESS]: {
- address: ADDRESS
- }
-};
-
-function createRedux () {
- return {
- dispatch: sinon.stub(),
- subscribe: sinon.stub(),
- getState: () => {
- return {
- balances: {
- balances: {
- [ADDRESS]: {}
- }
- },
- nodeStatus: {
- netVersion: '1',
- traceMode: false
- },
- personal: {
- accounts: {
- [ADDRESS]: {
- address: ADDRESS
- }
- }
- }
- };
- }
- };
-}
-
-export {
- ACCOUNTS,
- ADDRESS,
- createRedux
-};
diff --git a/js/packages/dapp-account/api.js b/js/packages/dapp-account/api.js
deleted file mode 100644
index b2e52cca0..000000000
--- a/js/packages/dapp-account/api.js
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import Api from '@parity/api';
-
-const ethereumProvider = window.ethereum || window.parent.ethereum;
-
-if (!ethereumProvider) {
- throw new Error('Unable to locate EthereumProvider, object not attached');
-}
-
-export default new Api(ethereumProvider);
diff --git a/js/packages/dapp-account/index.js b/js/packages/dapp-account/index.js
deleted file mode 100644
index 3ed2668ee..000000000
--- a/js/packages/dapp-account/index.js
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import ReactDOM from 'react-dom';
-import React from 'react';
-import { Route, Router, hashHistory } from 'react-router';
-
-import injectTapEventPlugin from 'react-tap-event-plugin';
-injectTapEventPlugin();
-
-import ContractInstances from '@parity/shared/contracts';
-import { initStore } from '@parity/shared/redux';
-import ContextProvider from '@parity/ui/ContextProvider';
-
-import api from './api';
-
-import Account from './account';
-
-ContractInstances.get(api);
-
-const store = initStore(api, hashHistory);
-
-ReactDOM.render(
-
-
-
-
- ,
- document.querySelector('#container')
-);
diff --git a/js/packages/dapp-account/package.json b/js/packages/dapp-account/package.json
deleted file mode 100644
index eef3fd3f7..000000000
--- a/js/packages/dapp-account/package.json
+++ /dev/null
@@ -1,25 +0,0 @@
-{
- "name": "@parity/dapp-account",
- "description": "Parity default account view",
- "version": "1.99.99",
- "main": "index.js",
- "author": "Parity Team ",
- "maintainers": [],
- "contributors": [],
- "license": "GPL-3.0",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/paritytech/dapp-account.git"
- },
- "keywords": [],
- "scripts": {},
- "devDependencies": {},
- "dependencies": {
- "@parity/parity.js": "1.8.7",
- "oo7": "0.5.3",
- "oo7-parity": "0.6.8",
- "oo7-react": "0.4.5",
- "parity-reactive-ui": "0.4.5"
- },
- "peerDependencies": {}
-}
diff --git a/js/packages/dapp-account/store.js b/js/packages/dapp-account/store.js
deleted file mode 100644
index f9046ee74..000000000
--- a/js/packages/dapp-account/store.js
+++ /dev/null
@@ -1,60 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { action, observable } from 'mobx';
-
-export default class Store {
- @observable isDeleteVisible = false;
- @observable isEditVisible = false;
- @observable isExportVisible = false;
- @observable isFaucetVisible = false;
- @observable isFundVisible = false;
- @observable isPasswordVisible = false;
- @observable isTransferVisible = false;
- @observable isVerificationVisible = false;
-
- @action toggleDeleteDialog = () => {
- this.isDeleteVisible = !this.isDeleteVisible;
- }
-
- @action toggleEditDialog = () => {
- this.isEditVisible = !this.isEditVisible;
- }
-
- @action toggleExportDialog = () => {
- this.isExportVisible = !this.isExportVisible;
- }
-
- @action toggleFaucetDialog = () => {
- this.isFaucetVisible = !this.isFaucetVisible;
- }
-
- @action toggleFundDialog = () => {
- this.isFundVisible = !this.isFundVisible;
- }
-
- @action togglePasswordDialog = () => {
- this.isPasswordVisible = !this.isPasswordVisible;
- }
-
- @action toggleTransferDialog = () => {
- this.isTransferVisible = !this.isTransferVisible;
- }
-
- @action toggleVerificationDialog = () => {
- this.isVerificationVisible = !this.isVerificationVisible;
- }
-}
diff --git a/js/packages/dapp-account/store.spec.js b/js/packages/dapp-account/store.spec.js
deleted file mode 100644
index 9608b55a3..000000000
--- a/js/packages/dapp-account/store.spec.js
+++ /dev/null
@@ -1,92 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import Store from './store';
-
-let store;
-
-function createStore () {
- store = new Store();
-}
-
-describe('views/Account/Store', () => {
- beforeEach(() => {
- createStore();
- });
-
- describe('constructor', () => {
- it('sets all modal visibility to false', () => {
- expect(store.isDeleteVisible).to.be.false;
- expect(store.isEditVisible).to.be.false;
- expect(store.isFaucetVisible).to.be.false;
- expect(store.isFundVisible).to.be.false;
- expect(store.isPasswordVisible).to.be.false;
- expect(store.isTransferVisible).to.be.false;
- expect(store.isVerificationVisible).to.be.false;
- });
- });
-
- describe('@action', () => {
- describe('toggleDeleteDialog', () => {
- it('toggles the visibility', () => {
- store.toggleDeleteDialog();
- expect(store.isDeleteVisible).to.be.true;
- });
- });
-
- describe('toggleEditDialog', () => {
- it('toggles the visibility', () => {
- store.toggleEditDialog();
- expect(store.isEditVisible).to.be.true;
- });
- });
-
- describe('toggleFaucetDialog', () => {
- it('toggles the visibility', () => {
- store.toggleFaucetDialog();
- expect(store.isFaucetVisible).to.be.true;
- });
- });
-
- describe('toggleFundDialog', () => {
- it('toggles the visibility', () => {
- store.toggleFundDialog();
- expect(store.isFundVisible).to.be.true;
- });
- });
-
- describe('togglePasswordDialog', () => {
- it('toggles the visibility', () => {
- store.togglePasswordDialog();
- expect(store.isPasswordVisible).to.be.true;
- });
- });
-
- describe('toggleTransferDialog', () => {
- it('toggles the visibility', () => {
- store.toggleTransferDialog();
- expect(store.isTransferVisible).to.be.true;
- });
- });
-
- describe('toggleVerificationDialog', () => {
- it('toggles the visibility', () => {
- store.toggleVerificationDialog();
- expect(store.isVerificationVisible).to.be.true;
- });
- });
- });
-});
diff --git a/js/packages/dapp-accounts/CreateAccount/AccountDetails/accountDetails.js b/js/packages/dapp-accounts/CreateAccount/AccountDetails/accountDetails.js
deleted file mode 100644
index d8c58d382..000000000
--- a/js/packages/dapp-accounts/CreateAccount/AccountDetails/accountDetails.js
+++ /dev/null
@@ -1,188 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { observer } from 'mobx-react';
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-
-import { IdentityIcon, Input, QrCode, Title } from '@parity/ui';
-
-import styles from '../createAccount.css';
-
-@observer
-export default class AccountDetails extends Component {
- static propTypes = {
- isConfirming: PropTypes.bool,
- withRequiredBackup: PropTypes.bool,
- createStore: PropTypes.object.isRequired
- }
-
- static defaultPropTypes = {
- isConfirming: false,
- withRequiredBackup: false
- }
-
- render () {
- const { address, description, name } = this.props.createStore;
-
- return (
-
- );
- }
-
- onEditPhraseBackedUp = (ev) => {
- this.props.createStore.setPhraseBackedUp(ev.target.value);
- }
-
- onEditPhrase = (ev) => {
- this.props.createStore.setPhrase(ev.target.value);
- }
-}
diff --git a/js/packages/dapp-accounts/CreateAccount/AccountDetails/accountDetails.spec.js b/js/packages/dapp-accounts/CreateAccount/AccountDetails/accountDetails.spec.js
deleted file mode 100644
index 99e1837cb..000000000
--- a/js/packages/dapp-accounts/CreateAccount/AccountDetails/accountDetails.spec.js
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { shallow } from 'enzyme';
-import React from 'react';
-
-import { createStore } from '../createAccount.test.js';
-
-import AccountDetails from './';
-
-let component;
-let store;
-
-function render () {
- store = createStore();
- component = shallow(
-
- );
-
- return component;
-}
-
-describe('modals/CreateAccount/AccountDetails', () => {
- it('renders with defaults', () => {
- expect(render()).to.be.ok;
- });
-});
diff --git a/js/packages/dapp-accounts/CreateAccount/AccountDetails/index.js b/js/packages/dapp-accounts/CreateAccount/AccountDetails/index.js
deleted file mode 100644
index ab1b88773..000000000
--- a/js/packages/dapp-accounts/CreateAccount/AccountDetails/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './accountDetails';
diff --git a/js/packages/dapp-accounts/CreateAccount/AccountDetailsGeth/accountDetailsGeth.js b/js/packages/dapp-accounts/CreateAccount/AccountDetailsGeth/accountDetailsGeth.js
deleted file mode 100644
index 662e0bfe2..000000000
--- a/js/packages/dapp-accounts/CreateAccount/AccountDetailsGeth/accountDetailsGeth.js
+++ /dev/null
@@ -1,68 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { observer } from 'mobx-react';
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-
-import { SectionList } from '@parity/ui';
-
-import GethCard from '../GethCard';
-
-import styles from '../createAccount.css';
-
-@observer
-export default class AccountDetailsGeth extends Component {
- static propTypes = {
- createStore: PropTypes.object.isRequired
- }
-
- render () {
- const { gethAccountsAvailable, gethImported } = this.props.createStore;
-
- const accounts = gethAccountsAvailable.filter((account) => gethImported.includes(account.address));
-
- return (
-
-
-
-
-
-
- );
- }
-
- renderAccount = (account, index) => {
- return (
-
- );
- }
-}
diff --git a/js/packages/dapp-accounts/CreateAccount/AccountDetailsGeth/accountDetailsGeth.spec.js b/js/packages/dapp-accounts/CreateAccount/AccountDetailsGeth/accountDetailsGeth.spec.js
deleted file mode 100644
index 6099202cf..000000000
--- a/js/packages/dapp-accounts/CreateAccount/AccountDetailsGeth/accountDetailsGeth.spec.js
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { shallow } from 'enzyme';
-import React from 'react';
-
-import { createStore } from '../createAccount.test.js';
-
-import AccountDetailsGeth from './';
-
-let component;
-let store;
-
-function render () {
- store = createStore();
- component = shallow(
-
- );
-
- return component;
-}
-
-describe('modals/CreateAccount/AccountDetailsGeth', () => {
- it('renders with defaults', () => {
- expect(render()).to.be.ok;
- });
-});
diff --git a/js/packages/dapp-accounts/CreateAccount/AccountDetailsGeth/index.js b/js/packages/dapp-accounts/CreateAccount/AccountDetailsGeth/index.js
deleted file mode 100644
index a5db55fc4..000000000
--- a/js/packages/dapp-accounts/CreateAccount/AccountDetailsGeth/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './accountDetailsGeth';
diff --git a/js/packages/dapp-accounts/CreateAccount/ChangeVault/changeVault.js b/js/packages/dapp-accounts/CreateAccount/ChangeVault/changeVault.js
deleted file mode 100644
index 02fe7da9a..000000000
--- a/js/packages/dapp-accounts/CreateAccount/ChangeVault/changeVault.js
+++ /dev/null
@@ -1,52 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { observer } from 'mobx-react';
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-
-import { VaultSelect } from '@parity/ui';
-
-@observer
-export default class ChangeVault extends Component {
- static propTypes = {
- createStore: PropTypes.object.isRequired,
- vaultStore: PropTypes.object
- }
-
- render () {
- const { createStore, vaultStore } = this.props;
- const { vaultName } = createStore;
-
- if (!vaultStore || vaultStore.vaultsOpened.length === 0) {
- return null;
- }
-
- return (
-
- );
- }
-
- onSelect = (vaultName) => {
- const { createStore } = this.props;
-
- createStore.setVaultName(vaultName);
- }
-}
diff --git a/js/packages/dapp-accounts/CreateAccount/ChangeVault/changeVault.spec.js b/js/packages/dapp-accounts/CreateAccount/ChangeVault/changeVault.spec.js
deleted file mode 100644
index 789facf8e..000000000
--- a/js/packages/dapp-accounts/CreateAccount/ChangeVault/changeVault.spec.js
+++ /dev/null
@@ -1,100 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { shallow } from 'enzyme';
-import React from 'react';
-import sinon from 'sinon';
-
-import ChangeVault from './';
-
-let component;
-let instance;
-let store;
-let vaultStore;
-
-function createStore () {
- store = {
- setVaultName: sinon.stub(),
- vaultName: 'testing'
- };
-
- return store;
-}
-
-function createVaultStore () {
- vaultStore = {
- vaultsOpened: ['testing']
- };
-
- return vaultStore;
-}
-
-function render () {
- component = shallow(
-
- );
- instance = component.instance();
-
- return component;
-}
-
-describe('modals/CreateAccount/ChangeVault', () => {
- beforeEach(() => {
- render();
- });
-
- it('renders defaults', () => {
- expect(component).to.be.ok;
- });
-
- describe('components', () => {
- describe('VaultSelect', () => {
- let select;
-
- beforeEach(() => {
- select = component.find('VaultSelect');
- });
-
- it('renders', () => {
- expect(select.get(0)).to.be.ok;
- });
-
- it('passes onSelect as instance method', () => {
- expect(select.props().onSelect).to.equal(instance.onSelect);
- });
-
- it('passes the value', () => {
- expect(select.props().value).to.equal('testing');
- });
-
- it('passes the vaultStore', () => {
- expect(select.props().vaultStore).to.equal(vaultStore);
- });
- });
- });
-
- describe('instance methods', () => {
- describe('onSelect', () => {
- it('calls into store setVaultName', () => {
- instance.onSelect('newName');
- expect(store.setVaultName).to.have.been.calledWith('newName');
- });
- });
- });
-});
diff --git a/js/packages/dapp-accounts/CreateAccount/ChangeVault/index.js b/js/packages/dapp-accounts/CreateAccount/ChangeVault/index.js
deleted file mode 100644
index 5eac8b21d..000000000
--- a/js/packages/dapp-accounts/CreateAccount/ChangeVault/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './changeVault';
diff --git a/js/packages/dapp-accounts/CreateAccount/CreationType/creationType.js b/js/packages/dapp-accounts/CreateAccount/CreationType/creationType.js
deleted file mode 100644
index 82655a866..000000000
--- a/js/packages/dapp-accounts/CreateAccount/CreationType/creationType.js
+++ /dev/null
@@ -1,192 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { observer } from 'mobx-react';
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-
-import { Container, SelectionList, Title } from '@parity/ui';
-
-import TypeIcon from '../TypeIcon';
-import styles from '../createAccount.css';
-
-const TYPES = [
- {
- description: (
-
- ),
- label: (
-
- ),
- key: 'fromNew'
- },
- {
- description: (
-
- ),
- label: (
-
- ),
- key: 'fromQr'
- },
- {
- description: (
-
- ),
- label: (
-
- ),
- key: 'fromGeth'
- },
- {
- description: (
-
- ),
- label: (
-
- ),
- key: 'fromJSON'
- },
- {
- description: (
-
- ),
- label: (
-
- ),
- key: 'fromRaw'
- },
- {
- description: (
-
- ),
- label: (
-
- ),
- key: 'fromPresale'
- }
-];
-
-@observer
-export default class CreationType extends Component {
- static propTypes = {
- createStore: PropTypes.object.isRequired
- }
-
- render () {
- const { createType } = this.props.createStore;
-
- return (
-
-
- );
- }
-
- isSelected = (item) => {
- const { createType } = this.props.createStore;
-
- return item.key === createType;
- }
-
- onChange = (item) => {
- const { createStore } = this.props;
-
- createStore.setCreateType(item.key);
- }
-
- onSelect = (item) => {
- const { createStore } = this.props;
-
- createStore.setCreateType(item.key);
- createStore.nextStage();
- }
-}
diff --git a/js/packages/dapp-accounts/CreateAccount/CreationType/creationType.spec.js b/js/packages/dapp-accounts/CreateAccount/CreationType/creationType.spec.js
deleted file mode 100644
index ddeaecae4..000000000
--- a/js/packages/dapp-accounts/CreateAccount/CreationType/creationType.spec.js
+++ /dev/null
@@ -1,60 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { shallow } from 'enzyme';
-import React from 'react';
-
-import { createStore } from '../createAccount.test.js';
-
-import CreationType from './';
-
-let component;
-let instance;
-let store;
-
-function render () {
- store = createStore();
- component = shallow(
-
- );
- instance = component.instance();
-
- return component;
-}
-
-describe('modals/CreateAccount/CreationType', () => {
- beforeEach(() => {
- render();
- });
-
- it('renders with defaults', () => {
- expect(component).to.be.ok;
- });
-
- describe('events', () => {
- describe('onChange', () => {
- beforeEach(() => {
- instance.onChange({ key: 'testing' });
- });
-
- it('changes the store createType', () => {
- expect(store.createType).to.equal('testing');
- });
- });
- });
-});
diff --git a/js/packages/dapp-accounts/CreateAccount/CreationType/index.js b/js/packages/dapp-accounts/CreateAccount/CreationType/index.js
deleted file mode 100644
index 8e831564a..000000000
--- a/js/packages/dapp-accounts/CreateAccount/CreationType/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './creationType';
diff --git a/js/packages/dapp-accounts/CreateAccount/GethCard/gethCard.js b/js/packages/dapp-accounts/CreateAccount/GethCard/gethCard.js
deleted file mode 100644
index 769666a3f..000000000
--- a/js/packages/dapp-accounts/CreateAccount/GethCard/gethCard.js
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-
-import { ETH_TOKEN } from '@parity/shared/util/tokens';
-import { AccountCard } from '@parity/ui';
-
-export default class GethCard extends Component {
- static propTypes = {
- address: PropTypes.string.isRequired,
- balance: PropTypes.string.isRequired,
- name: PropTypes.string.isRequired
- }
-
- render () {
- const { address, balance, name } = this.props;
-
- return (
-
- );
- }
-}
diff --git a/js/packages/dapp-accounts/CreateAccount/GethCard/index.js b/js/packages/dapp-accounts/CreateAccount/GethCard/index.js
deleted file mode 100644
index 8fdfca3c2..000000000
--- a/js/packages/dapp-accounts/CreateAccount/GethCard/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './gethCard';
diff --git a/js/packages/dapp-accounts/CreateAccount/NewAccount/index.js b/js/packages/dapp-accounts/CreateAccount/NewAccount/index.js
deleted file mode 100644
index 80734b486..000000000
--- a/js/packages/dapp-accounts/CreateAccount/NewAccount/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './newAccount';
diff --git a/js/packages/dapp-accounts/CreateAccount/NewAccount/newAccount.js b/js/packages/dapp-accounts/CreateAccount/NewAccount/newAccount.js
deleted file mode 100644
index 24d69dd32..000000000
--- a/js/packages/dapp-accounts/CreateAccount/NewAccount/newAccount.js
+++ /dev/null
@@ -1,258 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { observer } from 'mobx-react';
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-
-import { Button, Form, Input, IdentityIcon, Loading } from '@parity/ui';
-import PasswordStrength from '@parity/ui/Form/PasswordStrength';
-import { RefreshIcon } from '@parity/ui/Icons';
-
-import ChangeVault from '../ChangeVault';
-import styles from '../createAccount.css';
-
-@observer
-export default class CreateAccount extends Component {
- static propTypes = {
- newError: PropTypes.func.isRequired,
- createStore: PropTypes.object.isRequired,
- vaultStore: PropTypes.object
- }
-
- state = {
- accounts: null,
- selectedAddress: ''
- }
-
- componentWillMount () {
- return this.createIdentities();
- }
-
- render () {
- const { name, nameError, password, passwordRepeat, passwordRepeatError, passwordHint } = this.props.createStore;
-
- return (
-
- );
- }
-
- renderIdentities () {
- const { accounts, selectedAddress } = this.state;
-
- if (!accounts) {
- return (
-
- );
- }
-
- return (
-
- );
- }
-
- createIdentities = () => {
- const { createStore } = this.props;
-
- this.setState({
- accounts: null,
- selectedAddress: ''
- });
-
- createStore.setAddress('');
- createStore.setPhrase('');
-
- return createStore
- .createIdentities()
- .then((accounts) => {
- const selectedAddress = Object.keys(accounts)[0];
- const { phrase } = accounts[selectedAddress];
-
- createStore.setAddress(selectedAddress);
- createStore.setPhrase(phrase);
-
- this.setState({
- accounts,
- selectedAddress
- });
- })
- .catch((error) => {
- this.props.newError(error);
- });
- }
-
- onChangeIdentity = (event, selectedAddress) => {
- const { createStore } = this.props;
-
- if (!selectedAddress) {
- return;
- }
-
- this.setState({ selectedAddress }, () => {
- const { phrase } = this.state.accounts[selectedAddress];
-
- createStore.setAddress(selectedAddress);
- createStore.setPhrase(phrase);
- });
- }
-
- onEditPasswordHint = (event, passwordHint) => {
- const { createStore } = this.props;
-
- createStore.setPasswordHint(passwordHint);
- }
-
- onEditAccountName = (event, name) => {
- const { createStore } = this.props;
-
- createStore.setName(name);
- }
-
- onEditPassword = (event, password) => {
- const { createStore } = this.props;
-
- createStore.setPassword(password);
- }
-
- onEditPasswordRepeat = (event, password) => {
- const { createStore } = this.props;
-
- createStore.setPasswordRepeat(password);
- }
-}
diff --git a/js/packages/dapp-accounts/CreateAccount/NewAccount/newAccount.spec.js b/js/packages/dapp-accounts/CreateAccount/NewAccount/newAccount.spec.js
deleted file mode 100644
index 3df7ea58f..000000000
--- a/js/packages/dapp-accounts/CreateAccount/NewAccount/newAccount.spec.js
+++ /dev/null
@@ -1,161 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { shallow } from 'enzyme';
-import React from 'react';
-import sinon from 'sinon';
-
-import { createApi, createStore } from '../createAccount.test.js';
-
-import NewAccount from './';
-
-let api;
-let component;
-let instance;
-let store;
-
-function render () {
- api = createApi();
- store = createStore();
- component = shallow(
- ,
- {
- context: { api }
- }
- );
- instance = component.instance();
-
- return component;
-}
-
-describe('views/Accounts/CreateAccount/NewAccount', () => {
- beforeEach(() => {
- render();
- });
-
- it('renders with defaults', () => {
- expect(component).to.be.ok;
- });
-
- describe('lifecycle', () => {
- describe('componentWillMount', () => {
- beforeEach(() => {
- return instance.componentWillMount();
- });
-
- it('resets the accounts', () => {
- expect(instance.state.accounts).to.be.null;
- });
-
- it('resets the initial selected value', () => {
- expect(instance.state.selectedAddress).to.equal('');
- });
- });
- });
-
- describe('event handlers', () => {
- describe('onChangeIdentity', () => {
- let address;
-
- beforeEach(() => {
- address = Object.keys(instance.state.accounts)[3];
-
- sinon.spy(store, 'setAddress');
- sinon.spy(store, 'setPhrase');
- instance.onChangeIdentity(null, address);
- });
-
- afterEach(() => {
- store.setAddress.restore();
- store.setPhrase.restore();
- });
-
- it('sets the state with the new value', () => {
- expect(instance.state.selectedAddress).to.equal(address);
- });
-
- it('sets the new address on the store', () => {
- expect(store.setAddress).to.have.been.calledWith(address);
- });
-
- it('sets the new phrase on the store', () => {
- expect(store.setPhrase).to.have.been.calledWith(instance.state.accounts[address].phrase);
- });
- });
-
- describe('onEditPassword', () => {
- beforeEach(() => {
- sinon.spy(store, 'setPassword');
- instance.onEditPassword(null, 'test');
- });
-
- afterEach(() => {
- store.setPassword.restore();
- });
-
- it('calls into the store', () => {
- expect(store.setPassword).to.have.been.calledWith('test');
- });
- });
-
- describe('onEditPasswordRepeat', () => {
- beforeEach(() => {
- sinon.spy(store, 'setPasswordRepeat');
- instance.onEditPasswordRepeat(null, 'test');
- });
-
- afterEach(() => {
- store.setPasswordRepeat.restore();
- });
-
- it('calls into the store', () => {
- expect(store.setPasswordRepeat).to.have.been.calledWith('test');
- });
- });
-
- describe('onEditPasswordHint', () => {
- beforeEach(() => {
- sinon.spy(store, 'setPasswordHint');
- instance.onEditPasswordHint(null, 'test');
- });
-
- afterEach(() => {
- store.setPasswordHint.restore();
- });
-
- it('calls into the store', () => {
- expect(store.setPasswordHint).to.have.been.calledWith('test');
- });
- });
-
- describe('onEditAccountName', () => {
- beforeEach(() => {
- sinon.spy(store, 'setName');
- instance.onEditAccountName(null, 'test');
- });
-
- afterEach(() => {
- store.setName.restore();
- });
-
- it('calls into the store', () => {
- expect(store.setName).to.have.been.calledWith('test');
- });
- });
- });
-});
diff --git a/js/packages/dapp-accounts/CreateAccount/NewGeth/index.js b/js/packages/dapp-accounts/CreateAccount/NewGeth/index.js
deleted file mode 100644
index 5d5d6c010..000000000
--- a/js/packages/dapp-accounts/CreateAccount/NewGeth/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './newGeth';
diff --git a/js/packages/dapp-accounts/CreateAccount/NewGeth/newGeth.js b/js/packages/dapp-accounts/CreateAccount/NewGeth/newGeth.js
deleted file mode 100644
index b4c8bd7dc..000000000
--- a/js/packages/dapp-accounts/CreateAccount/NewGeth/newGeth.js
+++ /dev/null
@@ -1,98 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { observer } from 'mobx-react';
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-
-import { SelectionList } from '@parity/ui';
-
-import GethCard from '../GethCard';
-import styles from '../createAccount.css';
-
-@observer
-export default class NewGeth extends Component {
- static contextTypes = {
- api: PropTypes.object.isRequired
- }
-
- static propTypes = {
- createStore: PropTypes.object.isRequired
- }
-
- render () {
- const { gethAccountsAvailable, gethAddresses } = this.props.createStore;
-
- return gethAccountsAvailable.length
- ? (
-
- );
- }
-
- renderList (gethAccountsAvailable) {
- return (
-
- );
- }
-
- renderAccount = (account, index) => {
- return (
-
- );
- }
-
- isSelected = (account) => {
- const { gethAddresses } = this.props.createStore;
-
- return gethAddresses.includes(account.address);
- }
-
- onSelect = (account) => {
- const { createStore } = this.props;
-
- createStore.selectGethAccount(account.address);
- }
-}
diff --git a/js/packages/dapp-accounts/CreateAccount/NewGeth/newGeth.spec.js b/js/packages/dapp-accounts/CreateAccount/NewGeth/newGeth.spec.js
deleted file mode 100644
index b25eb7d01..000000000
--- a/js/packages/dapp-accounts/CreateAccount/NewGeth/newGeth.spec.js
+++ /dev/null
@@ -1,66 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { shallow } from 'enzyme';
-import React from 'react';
-import sinon from 'sinon';
-
-import { createStore } from '../createAccount.test.js';
-
-import NewGeth from './';
-
-let component;
-let instance;
-let store;
-
-function render () {
- store = createStore();
- component = shallow(
-
- );
- instance = component.instance();
-
- return component;
-}
-
-describe('modals/CreateAccount/NewGeth', () => {
- beforeEach(() => {
- render();
- });
-
- it('renders with defaults', () => {
- expect(render()).to.be.ok;
- });
-
- describe('events', () => {
- describe('onSelect', () => {
- beforeEach(() => {
- sinon.spy(store, 'selectGethAccount');
- instance.onSelect({ address: 'testAddress' });
- });
-
- afterEach(() => {
- store.selectGethAccount.restore();
- });
-
- it('calls into the store', () => {
- expect(store.selectGethAccount).to.have.been.calledWith('testAddress');
- });
- });
- });
-});
diff --git a/js/packages/dapp-accounts/CreateAccount/NewImport/index.js b/js/packages/dapp-accounts/CreateAccount/NewImport/index.js
deleted file mode 100644
index ecd5731a2..000000000
--- a/js/packages/dapp-accounts/CreateAccount/NewImport/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './newImport';
diff --git a/js/packages/dapp-accounts/CreateAccount/NewImport/newImport.js b/js/packages/dapp-accounts/CreateAccount/NewImport/newImport.js
deleted file mode 100644
index 9a6861f5b..000000000
--- a/js/packages/dapp-accounts/CreateAccount/NewImport/newImport.js
+++ /dev/null
@@ -1,160 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { observer } from 'mobx-react';
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-
-import { Form, FileSelect, Input } from '@parity/ui';
-
-import ChangeVault from '../ChangeVault';
-import styles from '../createAccount.css';
-
-@observer
-export default class NewImport extends Component {
- static propTypes = {
- createStore: PropTypes.object.isRequired,
- vaultStore: PropTypes.object
-
- }
-
- render () {
- const { name, nameError, password, passwordHint } = this.props.createStore;
-
- return (
-
- );
- }
-
- renderFileSelector () {
- const { walletFile, walletFileError } = this.props.createStore;
-
- return walletFile
- ? (
-
- }
- label={
-
- }
- value={ walletFile }
- />
- )
- : (
-
- );
- }
-
- onFileSelect = (fileName, fileContent) => {
- const { createStore } = this.props;
-
- createStore.setWalletFile(fileName);
- createStore.setWalletJson(fileContent);
- }
-
- onEditName = (event, name) => {
- const { createStore } = this.props;
-
- createStore.setName(name);
- }
-
- onEditPassword = (event, password) => {
- const { createStore } = this.props;
-
- createStore.setPassword(password);
- }
-
- onEditPasswordHint = (event, passwordHint) => {
- const { createStore } = this.props;
-
- createStore.setPasswordHint(passwordHint);
- }
-}
diff --git a/js/packages/dapp-accounts/CreateAccount/NewImport/newImport.spec.js b/js/packages/dapp-accounts/CreateAccount/NewImport/newImport.spec.js
deleted file mode 100644
index ecd73e3b4..000000000
--- a/js/packages/dapp-accounts/CreateAccount/NewImport/newImport.spec.js
+++ /dev/null
@@ -1,96 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { shallow } from 'enzyme';
-import React from 'react';
-import sinon from 'sinon';
-
-import { createStore } from '../createAccount.test.js';
-
-import NewImport from './';
-
-let component;
-let instance;
-let store;
-
-function render () {
- store = createStore();
- component = shallow(
-
- );
- instance = component.instance();
-
- return component;
-}
-
-describe('modals/CreateAccount/NewImport', () => {
- beforeEach(() => {
- render();
- });
-
- it('renders with defaults', () => {
- expect(render()).to.be.ok;
- });
-
- describe('events', () => {
- describe('onEditName', () => {
- beforeEach(() => {
- sinon.spy(store, 'setName');
- instance.onEditName(null, 'testValue');
- });
-
- afterEach(() => {
- store.setName.restore();
- });
-
- it('calls into the store', () => {
- expect(store.setName).to.have.been.calledWith('testValue');
- });
- });
-
- describe('onEditPassword', () => {
- beforeEach(() => {
- sinon.spy(store, 'setPassword');
- instance.onEditPassword(null, 'testValue');
- });
-
- afterEach(() => {
- store.setPassword.restore();
- });
-
- it('calls into the store', () => {
- expect(store.setPassword).to.have.been.calledWith('testValue');
- });
- });
-
- describe('onEditPasswordHint', () => {
- beforeEach(() => {
- sinon.spy(store, 'setPasswordHint');
- instance.onEditPasswordHint(null, 'testValue');
- });
-
- afterEach(() => {
- store.setPasswordHint.restore();
- });
-
- it('calls into the store', () => {
- expect(store.setPasswordHint).to.have.been.calledWith('testValue');
- });
- });
- });
-});
diff --git a/js/packages/dapp-accounts/CreateAccount/NewQr/index.js b/js/packages/dapp-accounts/CreateAccount/NewQr/index.js
deleted file mode 100644
index e9eeee1e4..000000000
--- a/js/packages/dapp-accounts/CreateAccount/NewQr/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './newQr';
diff --git a/js/packages/dapp-accounts/CreateAccount/NewQr/newQr.js b/js/packages/dapp-accounts/CreateAccount/NewQr/newQr.js
deleted file mode 100644
index 9d12d7eb0..000000000
--- a/js/packages/dapp-accounts/CreateAccount/NewQr/newQr.js
+++ /dev/null
@@ -1,137 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { observer } from 'mobx-react';
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-
-import { Form, Input, InputAddress, QrScan } from '@parity/ui';
-
-import ChangeVault from '../ChangeVault';
-
-@observer
-export default class NewQr extends Component {
- static propTypes = {
- createStore: PropTypes.object.isRequired,
- vaultStore: PropTypes.object.isRequired
- };
-
- render () {
- const { createStore } = this.props;
-
- return createStore.qrAddressValid
- ? this.renderInfo()
- : this.renderScanner();
- }
-
- renderInfo () {
- const { createStore, vaultStore } = this.props;
- const { description, name, nameError, qrAddress } = createStore;
-
- return (
-
- );
- }
-
- renderScanner () {
- return (
-
-
-
-
- );
- }
-
- onEditAccountDescription = (event, description) => {
- const { createStore } = this.props;
-
- createStore.setDescription(description);
- }
-
- onEditAccountName = (event, name) => {
- const { createStore } = this.props;
-
- createStore.setName(name);
- }
-
- onScan = (address) => {
- const { createStore } = this.props;
-
- console.log('QR scan', address);
-
- createStore.setQrAddress(address);
- }
-}
diff --git a/js/packages/dapp-accounts/CreateAccount/NewQr/newQr.spec.js b/js/packages/dapp-accounts/CreateAccount/NewQr/newQr.spec.js
deleted file mode 100644
index 6fb567ad7..000000000
--- a/js/packages/dapp-accounts/CreateAccount/NewQr/newQr.spec.js
+++ /dev/null
@@ -1,93 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { shallow } from 'enzyme';
-import React from 'react';
-import sinon from 'sinon';
-
-import NewQr from './';
-
-let component;
-let instance;
-let createStore;
-let vaultStore;
-
-function createStores () {
- createStore = {
- qrAddressValid: false,
- setDescription: sinon.stub(),
- setName: sinon.stub(),
- setQrAddress: sinon.stub()
- };
-
- vaultStore = {};
-}
-
-function render (props = {}) {
- createStores();
-
- component = shallow(
-
- );
- instance = component.instance();
-
- return component;
-}
-
-describe('modals/CreateAccount/NewQr', () => {
- beforeEach(() => {
- render();
- });
-
- it('renders defaults', () => {
- expect(component).to.be.ok;
- });
-
- describe('event methods', () => {
- describe('onEditAccountDescription', () => {
- beforeEach(() => {
- instance.onEditAccountDescription(null, 'testing');
- });
-
- it('calls into createStore.setDescription', () => {
- expect(createStore.setDescription).to.have.been.calledWith('testing');
- });
- });
-
- describe('onEditAccountName', () => {
- beforeEach(() => {
- instance.onEditAccountName(null, 'testing');
- });
-
- it('calls into createStore.setName', () => {
- expect(createStore.setName).to.have.been.calledWith('testing');
- });
- });
-
- describe('onScan', () => {
- beforeEach(() => {
- instance.onScan('testing');
- });
-
- it('calls into createStore.setQrAddress', () => {
- expect(createStore.setQrAddress).to.have.been.calledWith('testing');
- });
- });
- });
-});
diff --git a/js/packages/dapp-accounts/CreateAccount/RawKey/index.js b/js/packages/dapp-accounts/CreateAccount/RawKey/index.js
deleted file mode 100644
index 3ec14db73..000000000
--- a/js/packages/dapp-accounts/CreateAccount/RawKey/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './rawKey';
diff --git a/js/packages/dapp-accounts/CreateAccount/RawKey/rawKey.js b/js/packages/dapp-accounts/CreateAccount/RawKey/rawKey.js
deleted file mode 100644
index 699d79767..000000000
--- a/js/packages/dapp-accounts/CreateAccount/RawKey/rawKey.js
+++ /dev/null
@@ -1,174 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { observer } from 'mobx-react';
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-
-import { Form, Input } from '@parity/ui';
-import PasswordStrength from '@parity/ui/Form/PasswordStrength';
-
-import ChangeVault from '../ChangeVault';
-import styles from '../createAccount.css';
-
-@observer
-export default class RawKey extends Component {
- static contextTypes = {
- api: PropTypes.object.isRequired
- }
-
- static propTypes = {
- createStore: PropTypes.object.isRequired,
- vaultStore: PropTypes.object
- }
-
- render () {
- const { name, nameError, password, passwordRepeat, passwordRepeatError, passwordHint, rawKey, rawKeyError } = this.props.createStore;
-
- return (
-
- );
- }
-
- onEditName = (event, name) => {
- const { createStore } = this.props;
-
- createStore.setName(name);
- }
-
- onEditPasswordHint = (event, passwordHint) => {
- const { createStore } = this.props;
-
- createStore.setPasswordHint(passwordHint);
- }
-
- onEditPassword = (event, password) => {
- const { createStore } = this.props;
-
- createStore.setPassword(password);
- }
-
- onEditPasswordRepeat = (event, password) => {
- const { createStore } = this.props;
-
- createStore.setPasswordRepeat(password);
- }
-
- onEditKey = (event, rawKey) => {
- const { createStore } = this.props;
-
- createStore.setRawKey(rawKey);
- }
-}
diff --git a/js/packages/dapp-accounts/CreateAccount/RawKey/rawKey.spec.js b/js/packages/dapp-accounts/CreateAccount/RawKey/rawKey.spec.js
deleted file mode 100644
index 121336d78..000000000
--- a/js/packages/dapp-accounts/CreateAccount/RawKey/rawKey.spec.js
+++ /dev/null
@@ -1,126 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { shallow } from 'enzyme';
-import React from 'react';
-import sinon from 'sinon';
-
-import { createStore } from '../createAccount.test.js';
-
-import RawKey from './';
-
-let component;
-let instance;
-let store;
-
-function render () {
- store = createStore();
- component = shallow(
-
- );
- instance = component.instance();
-
- return component;
-}
-
-describe('modals/CreateAccount/RawKey', () => {
- beforeEach(() => {
- render();
- });
-
- it('renders with defaults', () => {
- expect(component).to.be.ok;
- });
-
- describe('events', () => {
- describe('onEditName', () => {
- beforeEach(() => {
- sinon.spy(store, 'setName');
- instance.onEditName(null, 'testValue');
- });
-
- afterEach(() => {
- store.setName.restore();
- });
-
- it('calls into the store', () => {
- expect(store.setName).to.have.been.calledWith('testValue');
- });
- });
-
- describe('onEditKey', () => {
- beforeEach(() => {
- sinon.spy(store, 'setRawKey');
- instance.onEditKey(null, 'testValue');
- });
-
- afterEach(() => {
- store.setRawKey.restore();
- });
-
- it('calls into the store', () => {
- expect(store.setRawKey).to.have.been.calledWith('testValue');
- });
- });
-
- describe('onEditPassword', () => {
- beforeEach(() => {
- sinon.spy(store, 'setPassword');
- instance.onEditPassword(null, 'testValue');
- });
-
- afterEach(() => {
- store.setPassword.restore();
- });
-
- it('calls into the store', () => {
- expect(store.setPassword).to.have.been.calledWith('testValue');
- });
- });
-
- describe('onEditPasswordRepeat', () => {
- beforeEach(() => {
- sinon.spy(store, 'setPasswordRepeat');
- instance.onEditPasswordRepeat(null, 'testValue');
- });
-
- afterEach(() => {
- store.setPasswordRepeat.restore();
- });
-
- it('calls into the store', () => {
- expect(store.setPasswordRepeat).to.have.been.calledWith('testValue');
- });
- });
-
- describe('onEditPasswordHint', () => {
- beforeEach(() => {
- sinon.spy(store, 'setPasswordHint');
- instance.onEditPasswordHint(null, 'testValue');
- });
-
- afterEach(() => {
- store.setPasswordHint.restore();
- });
-
- it('calls into the store', () => {
- expect(store.setPasswordHint).to.have.been.calledWith('testValue');
- });
- });
- });
-});
diff --git a/js/packages/dapp-accounts/CreateAccount/RecoveryPhrase/index.js b/js/packages/dapp-accounts/CreateAccount/RecoveryPhrase/index.js
deleted file mode 100644
index d32d11d6e..000000000
--- a/js/packages/dapp-accounts/CreateAccount/RecoveryPhrase/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './recoveryPhrase';
diff --git a/js/packages/dapp-accounts/CreateAccount/RecoveryPhrase/recoveryPhrase.js b/js/packages/dapp-accounts/CreateAccount/RecoveryPhrase/recoveryPhrase.js
deleted file mode 100644
index ad480d519..000000000
--- a/js/packages/dapp-accounts/CreateAccount/RecoveryPhrase/recoveryPhrase.js
+++ /dev/null
@@ -1,254 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { observer } from 'mobx-react';
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-
-import { Checkbox, Form, Input, Warning } from '@parity/ui';
-import PasswordStrength from '@parity/ui/Form/PasswordStrength';
-
-import ChangeVault from '../ChangeVault';
-import styles from '../createAccount.css';
-
-@observer
-export default class RecoveryPhrase extends Component {
- static propTypes = {
- createStore: PropTypes.object.isRequired,
- vaultStore: PropTypes.object
- }
-
- render () {
- const { isWindowsPhrase, name, nameError, passPhraseError, password, passwordRepeat, passwordRepeatError, passwordHint, phrase } = this.props.createStore;
-
- return (
-
- { this.renderWarning() }
-
-
- );
- }
-
- renderWarning () {
- const { isTest, phrase } = this.props.createStore;
-
- if (!isTest && phrase.length === 0) {
- return (
-
- }
- />
- );
- }
-
- if (phrase.length === 0) {
- return (
-
- }
- />
- );
- }
-
- const words = phrase.split(' ');
-
- if (words.length < 11) {
- return (
-
- }
- />
- );
- }
-
- return null;
- }
-
- onToggleWindowsPhrase = (event) => {
- const { createStore } = this.props;
-
- createStore.setWindowsPhrase(!createStore.isWindowsPhrase);
- }
-
- onEditPhrase = (event, phrase) => {
- const { createStore } = this.props;
-
- createStore.setPhrase(phrase);
- }
-
- onEditName = (event, name) => {
- const { createStore } = this.props;
-
- createStore.setName(name);
- }
-
- onEditPassword = (event, password) => {
- const { createStore } = this.props;
-
- createStore.setPassword(password);
- }
-
- onEditPasswordRepeat = (event, password) => {
- const { createStore } = this.props;
-
- createStore.setPasswordRepeat(password);
- }
-
- onEditPasswordHint = (event, passwordHint) => {
- const { createStore } = this.props;
-
- createStore.setPasswordHint(passwordHint);
- }
-}
diff --git a/js/packages/dapp-accounts/CreateAccount/RecoveryPhrase/recoveryPhrase.spec.js b/js/packages/dapp-accounts/CreateAccount/RecoveryPhrase/recoveryPhrase.spec.js
deleted file mode 100644
index d6b5d3e70..000000000
--- a/js/packages/dapp-accounts/CreateAccount/RecoveryPhrase/recoveryPhrase.spec.js
+++ /dev/null
@@ -1,141 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { shallow } from 'enzyme';
-import React from 'react';
-import sinon from 'sinon';
-
-import { createStore } from '../createAccount.test.js';
-
-import RecoveryPhrase from './';
-
-let component;
-let instance;
-let store;
-
-function render () {
- store = createStore();
- component = shallow(
-
- );
- instance = component.instance();
-
- return component;
-}
-
-describe('modals/CreateAccount/RecoveryPhrase', () => {
- beforeEach(() => {
- render();
- });
-
- it('renders with defaults', () => {
- expect(component).to.be.ok;
- });
-
- describe('event handlers', () => {
- describe('onEditName', () => {
- beforeEach(() => {
- sinon.spy(store, 'setName');
- instance.onEditName(null, 'testValue');
- });
-
- afterEach(() => {
- store.setName.restore();
- });
-
- it('calls into the store', () => {
- expect(store.setName).to.have.been.calledWith('testValue');
- });
- });
-
- describe('onEditPhrase', () => {
- beforeEach(() => {
- sinon.spy(store, 'setPhrase');
- instance.onEditPhrase(null, 'testValue');
- });
-
- afterEach(() => {
- store.setPhrase.restore();
- });
-
- it('calls into the store', () => {
- expect(store.setPhrase).to.have.been.calledWith('testValue');
- });
- });
-
- describe('onEditPassword', () => {
- beforeEach(() => {
- sinon.spy(store, 'setPassword');
- instance.onEditPassword(null, 'testValue');
- });
-
- afterEach(() => {
- store.setPassword.restore();
- });
-
- it('calls into the store', () => {
- expect(store.setPassword).to.have.been.calledWith('testValue');
- });
- });
-
- describe('onEditPasswordRepeat', () => {
- beforeEach(() => {
- sinon.spy(store, 'setPasswordRepeat');
- instance.onEditPasswordRepeat(null, 'testValue');
- });
-
- afterEach(() => {
- store.setPasswordRepeat.restore();
- });
-
- it('calls into the store', () => {
- expect(store.setPasswordRepeat).to.have.been.calledWith('testValue');
- });
- });
-
- describe('onEditPasswordHint', () => {
- beforeEach(() => {
- sinon.spy(store, 'setPasswordHint');
- instance.onEditPasswordHint(null, 'testValue');
- });
-
- afterEach(() => {
- store.setPasswordHint.restore();
- });
-
- it('calls into the store', () => {
- expect(store.setPasswordHint).to.have.been.calledWith('testValue');
- });
- });
-
- describe('onToggleWindowsPhrase', () => {
- beforeEach(() => {
- sinon.spy(store, 'setWindowsPhrase');
- instance.onToggleWindowsPhrase();
- });
-
- afterEach(() => {
- store.setWindowsPhrase.restore();
- });
-
- it('calls into the store', () => {
- expect(store.setWindowsPhrase).to.have.been.calledWith(true);
- });
- });
- });
-});
diff --git a/js/packages/dapp-accounts/CreateAccount/TypeIcon/index.js b/js/packages/dapp-accounts/CreateAccount/TypeIcon/index.js
deleted file mode 100644
index 55bc79d6b..000000000
--- a/js/packages/dapp-accounts/CreateAccount/TypeIcon/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './typeIcon';
diff --git a/js/packages/dapp-accounts/CreateAccount/TypeIcon/typeIcon.js b/js/packages/dapp-accounts/CreateAccount/TypeIcon/typeIcon.js
deleted file mode 100644
index f98c10874..000000000
--- a/js/packages/dapp-accounts/CreateAccount/TypeIcon/typeIcon.js
+++ /dev/null
@@ -1,73 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-
-import { AccountsIcon, DoneIcon, FileIcon, FileUploadIcon, KeyboardIcon, KeyIcon, MembershipIcon, QrIcon } from '@parity/ui/Icons';
-
-import { STAGE_INFO } from '../store';
-
-export default class TypeIcon extends Component {
- static propTypes = {
- className: PropTypes.string,
- createStore: PropTypes.object.isRequired,
- type: PropTypes.string
- }
-
- render () {
- const { className } = this.props;
-
- return (
-
- { this.getIcon() }
-
- );
- }
-
- getIcon () {
- const { createStore, type } = this.props;
- const { createType, stage } = createStore;
-
- if (stage === STAGE_INFO) {
- return ;
- }
-
- switch (type || createType) {
- case 'fromGeth':
- return ;
-
- case 'fromJSON':
- return ;
-
- case 'fromPhrase':
- return ;
-
- case 'fromPresale':
- return ;
-
- case 'fromQr':
- return ;
-
- case 'fromRaw':
- return ;
-
- case 'fromNew':
- default:
- return ;
- }
- }
-}
diff --git a/js/packages/dapp-accounts/CreateAccount/createAccount.css b/js/packages/dapp-accounts/CreateAccount/createAccount.css
deleted file mode 100644
index 744130024..000000000
--- a/js/packages/dapp-accounts/CreateAccount/createAccount.css
+++ /dev/null
@@ -1,150 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.details {
- width: 100%;
-
- .info {
- display: flex;
- flex-direction: row;
- flex-wrap: nowrap;
-
- .account {
- display: flex;
- flex-direction: column;
- flex: 1;
-
- .name {
- display: flex;
- flex-direction: row;
- flex: 1;
-
- .icon {
- flex: 0 0 56px;
- margin: 0 1em 0 0;
- }
-
- .title {
- flex: 1;
- }
- }
-
- .description {
- flex: 1;
- }
- }
-
- .qr {
- flex: 0 0 136px;
- margin: 1.5em 0 0 1.5em;
- }
- }
-}
-
-.spaced {
- line-height: 1.618em;
-}
-
-/* TODO: 2 column layout can be made generic, now duplicated in Vaults */
-.passwords {
- display: flex;
- flex-wrap: wrap;
-
- .password {
- box-sizing: border-box;
- flex: 0 1 50%;
- width: 50%;
-
- &:nth-child(odd) {
- padding-right: 0.25rem;
- }
-
- &:nth-child(even) {
- padding-left: 0.25rem;
- }
- }
-}
-
-.identities {
- align-items: center;
- display: flex;
-
- .identity {
- cursor: pointer;
- flex: 0 1 12.5%;
- padding: 0.75em 0;
- text-align: center;
- width: 12.5% !important;
-
- > img {
- border: 2px solid transparent;
- box-sizing: content-box;
- padding: 1em;
- }
-
- &.selected {
- > img {
- background: white;
- border-color: #2185D0;
- }
- }
-
- &.unselected {
- opacity: 0.75;
- }
- }
-}
-
-.refresh {
- flex: 0 1 10%;
- width: 10% !important;
-}
-
-.checkbox {
- margin-top: 2em;
-}
-
-.selectItem {
- display: flex;
-
- .icon {
- color: rgb(167, 151, 0) !important;
- flex: 0 0 56px;
- font-size: 56px;
- margin: 1.5rem 1.5rem 0 0;
- }
-
- .info {
- flex: 1 1;
- }
-}
-
-.fileImport {
- height: 9em;
- margin-top: 1em;
-}
-
-.summary {
- line-height: 1.618em;
- padding: 0 4em 1.5em 4em;
- text-align: center;
-}
-
-.backupPhrase {
- line-height: 1.618em;
- margin-top: 1.5em;
-}
diff --git a/js/packages/dapp-accounts/CreateAccount/createAccount.js b/js/packages/dapp-accounts/CreateAccount/createAccount.js
deleted file mode 100644
index 3edc41a19..000000000
--- a/js/packages/dapp-accounts/CreateAccount/createAccount.js
+++ /dev/null
@@ -1,440 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { observer } from 'mobx-react';
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-import { connect } from 'react-redux';
-import { bindActionCreators } from 'redux';
-
-import { createIdentityImg } from '@parity/api/util/identity';
-import { newError } from '@parity/shared/redux/actions';
-import { Button, ModalBox, Portal } from '@parity/ui';
-import { CancelIcon, CheckIcon, DoneIcon, NextIcon, PrevIcon, PrintIcon } from '@parity/ui/Icons';
-
-import ParityLogo from '@parity/shared/assets/images/parity-logo-black-no-text.svg';
-
-import VaultStore from '@parity/dapp-vaults/store';
-
-import AccountDetails from './AccountDetails';
-import AccountDetailsGeth from './AccountDetailsGeth';
-import CreationType from './CreationType';
-import NewAccount from './NewAccount';
-import NewGeth from './NewGeth';
-import NewImport from './NewImport';
-import NewQr from './NewQr';
-import RawKey from './RawKey';
-import RecoveryPhrase from './RecoveryPhrase';
-import Store, { STAGE_CREATE, STAGE_INFO, STAGE_SELECT_TYPE, STAGE_CONFIRM_BACKUP } from './store';
-import TypeIcon from './TypeIcon';
-import print from './print';
-import recoveryPage from './recoveryPage.ejs';
-
-const TITLES = {
- type: (
-
- ),
- create: (
-
- ),
- info: (
-
- ),
- backup: (
-
- ),
- import: (
-
- ),
- restore: (
-
- ),
- qr: (
-
- )
-};
-const STAGE_NAMES = [TITLES.type, TITLES.create, TITLES.info, TITLES.backup];
-const STAGE_IMPORT = [TITLES.type, TITLES.import, TITLES.info];
-const STAGE_RESTORE = [TITLES.restore, TITLES.info];
-const STAGE_QR = [TITLES.type, TITLES.qr, TITLES.info];
-
-@observer
-class CreateAccount extends Component {
- static contextTypes = {
- api: PropTypes.object.isRequired
- };
-
- static propTypes = {
- accounts: PropTypes.object.isRequired,
- isTest: PropTypes.bool.isRequired,
- newError: PropTypes.func.isRequired,
- onClose: PropTypes.func,
- onUpdate: PropTypes.func,
- restore: PropTypes.bool
- };
-
- static defaultProps = {
- restore: false
- };
-
- createStore = new Store(this.context.api, this.props.accounts, this.props.isTest);
- vaultStore = VaultStore.get(this.context.api);
-
- componentWillMount () {
- if (this.props.restore) {
- this.createStore.setCreateType('fromPhrase');
- this.createStore.nextStage();
- }
-
- return this.vaultStore.loadVaults();
- }
-
- render () {
- const { isBusy, createType, stage } = this.createStore;
-
- let steps = STAGE_IMPORT;
-
- if (createType === 'fromNew') {
- steps = STAGE_NAMES;
- } else if (createType === 'fromQr') {
- steps = STAGE_QR;
- } else if (createType === 'fromPhrase') {
- steps = STAGE_RESTORE;
- }
-
- return (
-
- }>
- { this.renderPage() }
-
-
- );
- }
-
- renderPage () {
- const { createType, stage } = this.createStore;
-
- switch (stage) {
- case STAGE_SELECT_TYPE:
- return (
-
- );
-
- case STAGE_CREATE:
- if (createType === 'fromNew') {
- return (
-
- );
- }
-
- if (createType === 'fromGeth') {
- return (
-
- );
- }
-
- if (createType === 'fromPhrase') {
- return (
-
- );
- }
-
- if (createType === 'fromQr') {
- return (
-
- );
- }
-
- if (createType === 'fromRaw') {
- return (
-
- );
- }
-
- return (
-
- );
-
- case STAGE_INFO:
- if (createType === 'fromGeth') {
- return (
-
- );
- }
-
- return (
-
- );
-
- case STAGE_CONFIRM_BACKUP:
- return (
-
- );
- }
- }
-
- renderDialogActions () {
- const { restore } = this.props;
- const { createType, canCreate, isBusy, stage, phraseBackedUpError } = this.createStore;
-
- const cancelBtn = (
- }
- key='cancel'
- label={
-
- }
- onClick={ this.onClose }
- />
- );
-
- const backBtn = restore
- ? null
- : (
- }
- key='back'
- label={
-
- }
- onClick={ this.createStore.prevStage }
- />
- );
-
- switch (stage) {
- case STAGE_SELECT_TYPE:
- return [
- cancelBtn,
- }
- key='next'
- label={
-
- }
- onClick={ this.createStore.nextStage }
- />
- ];
-
- case STAGE_CREATE:
- return [
- cancelBtn,
- backBtn,
- }
- key='create'
- label={
- createType === 'fromNew'
- ? (
-
- )
- : (
-
- )
- }
- onClick={ createType === 'fromNew' ? this.createStore.nextStage : this.onCreate }
- />
- ];
-
- case STAGE_INFO:
- return [
- ['fromNew', 'fromPhrase'].includes(createType)
- ? (
- }
- key='print'
- label={
-
- }
- onClick={ this.printPhrase }
- />
- )
- : null,
- }
- key='done'
- label={
-
- }
- onClick={ createType === 'fromNew' ? this.onConfirmPhraseBackup : this.onClose }
- />
- ];
-
- case STAGE_CONFIRM_BACKUP:
- return [
- }
- key='done'
- label={
-
- }
- onClick={ this.onCreateNew }
- />
- ];
- }
- }
-
- onConfirmPhraseBackup = () => {
- this.createStore.clearPhrase();
- this.createStore.nextStage();
- }
-
- onCreateNew = () => {
- this.createStore.setBusy(true);
- this.createStore.computeBackupPhraseAddress()
- .then(err => {
- if (err) {
- this.createStore.setBusy(false);
- return;
- }
-
- return this.createStore.createAccount(this.vaultStore)
- .then(() => {
- this.createStore.clearPhrase();
- this.createStore.setBusy(false);
- this.props.onUpdate && this.props.onUpdate();
- this.onClose();
- });
- })
- .catch((error) => {
- this.createStore.setBusy(false);
- this.props.newError(error);
- });
- }
-
- onCreate = () => {
- return this.createStore
- .createAccount(this.vaultStore)
- .then(() => {
- this.createStore.nextStage();
- this.props.onUpdate && this.props.onUpdate();
- })
- .catch((error) => {
- this.props.newError(error);
- });
- }
-
- onClose = () => {
- this.createStore.clearPhrase();
- this.props.onClose && this.props.onClose();
- }
-
- printPhrase = () => {
- const { address, name, phrase } = this.createStore;
- const identity = createIdentityImg(address);
-
- print(recoveryPage({
- address,
- identity,
- logo: ParityLogo,
- name,
- phrase
- }));
- }
-}
-
-function mapStateToProps (state) {
- const { isTest } = state.nodeStatus;
-
- return { isTest };
-}
-
-function mapDispatchToProps (dispatch) {
- return bindActionCreators({
- newError
- }, dispatch);
-}
-
-export default connect(
- mapStateToProps,
- mapDispatchToProps
-)(CreateAccount);
diff --git a/js/packages/dapp-accounts/CreateAccount/createAccount.spec.js b/js/packages/dapp-accounts/CreateAccount/createAccount.spec.js
deleted file mode 100644
index da7feb71d..000000000
--- a/js/packages/dapp-accounts/CreateAccount/createAccount.spec.js
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { shallow } from 'enzyme';
-import React from 'react';
-
-import { ACCOUNTS, createApi, createRedux } from './createAccount.test.js';
-
-import CreateAccount from './';
-
-let api;
-let component;
-
-function render () {
- api = createApi();
- component = shallow(
- ,
- {
- context: {
- store: createRedux()
- }
- }
- ).find('CreateAccount').shallow({
- context: { api }
- });
-
- return component;
-}
-
-describe('modals/CreateAccount', () => {
- describe('rendering', () => {
- it('renders with defaults', () => {
- expect(render()).to.be.ok;
- });
- });
-});
diff --git a/js/packages/dapp-accounts/CreateAccount/createAccount.test.js b/js/packages/dapp-accounts/CreateAccount/createAccount.test.js
deleted file mode 100644
index ac0c42adc..000000000
--- a/js/packages/dapp-accounts/CreateAccount/createAccount.test.js
+++ /dev/null
@@ -1,79 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import BigNumber from 'bignumber.js';
-import sinon from 'sinon';
-
-import Api from '@parity/api/index';
-import Store from './store';
-
-const ADDRESS = '0x00000123456789abcdef123456789abcdef123456789abcdef';
-const ACCOUNTS = { [ADDRESS]: {} };
-const GETH_ADDRESSES = [
- '0x123456789abcdef123456789abcdef123456789abcdef00000',
- '0x00000123456789abcdef123456789abcdef123456789abcdef'
-];
-
-let counter = 1;
-
-function createApi () {
- return {
- eth: {
- getBalance: sinon.stub().resolves(new BigNumber(1))
- },
- parity: {
- generateSecretPhrase: sinon.stub().resolves('some account phrase'),
- importGethAccounts: sinon.stub().resolves(GETH_ADDRESSES),
- listGethAccounts: sinon.stub().resolves(GETH_ADDRESSES),
- newAccountFromPhrase: sinon.stub().resolves(ADDRESS),
- newAccountFromSecret: sinon.stub().resolves(ADDRESS),
- newAccountFromWallet: sinon.stub().resolves(ADDRESS),
- phraseToAddress: () => Promise.resolve(`${++counter}`),
- setAccountMeta: sinon.stub().resolves(),
- setAccountName: sinon.stub().resolves(),
- listVaults: sinon.stub().resolves([]),
- listOpenedVaults: sinon.stub().resolves([])
- },
- util: Api.util
- };
-}
-
-function createRedux () {
- return {
- dispatch: sinon.stub(),
- subscribe: sinon.stub(),
- getState: () => {
- return {
- nodeStatus: {
- isTest: true
- }
- };
- }
- };
-}
-
-function createStore () {
- return new Store(createApi(), ACCOUNTS);
-}
-
-export {
- ACCOUNTS,
- ADDRESS,
- GETH_ADDRESSES,
- createApi,
- createRedux,
- createStore
-};
diff --git a/js/packages/dapp-accounts/CreateAccount/errors.js b/js/packages/dapp-accounts/CreateAccount/errors.js
deleted file mode 100644
index 3b9ed2669..000000000
--- a/js/packages/dapp-accounts/CreateAccount/errors.js
+++ /dev/null
@@ -1,77 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React from 'react';
-import { FormattedMessage } from 'react-intl';
-
-export default {
- duplicateName: (
-
- ),
-
- noFile: (
-
- ),
-
- noKey: (
-
- ),
-
- noMatchPassword: (
-
- ),
-
- noMatchBackupPhrase: (
-
- ),
-
- noMatchPhraseBackedUp: (
-
- ),
-
- noName: (
-
- ),
-
- invalidKey: (
-
- )
-
-};
diff --git a/js/packages/dapp-accounts/CreateAccount/index.js b/js/packages/dapp-accounts/CreateAccount/index.js
deleted file mode 100644
index 23dcf8880..000000000
--- a/js/packages/dapp-accounts/CreateAccount/index.js
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import AccountDetails from './AccountDetails';
-import NewAccount from './NewAccount';
-
-export default from './createAccount';
-export { AccountDetails, NewAccount };
diff --git a/js/packages/dapp-accounts/CreateAccount/print.js b/js/packages/dapp-accounts/CreateAccount/print.js
deleted file mode 100644
index 634a410dc..000000000
--- a/js/packages/dapp-accounts/CreateAccount/print.js
+++ /dev/null
@@ -1,70 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export const onPrint = (window, cb) => {
- let called = false;
- let query;
- let queryFn;
-
- const onPrint = () => {
- if (queryFn) {
- query.removeListener(queryFn);
- }
-
- window.removeEventListener('afterprint', onPrint, false);
-
- if (!called) {
- called = true;
- cb();
- }
- };
-
- if (window.matchMedia) {
- queryFn = (query) => {
- if (!query.matches) {
- onPrint();
- }
- };
-
- query = window.matchMedia('print');
- query.addListener(queryFn);
- }
-
- window.addEventListener('afterprint', onPrint, false);
-};
-
-export default (html) => {
- const iframe = document.createElement('iframe');
-
- iframe.setAttribute('sandbox', 'allow-modals allow-same-origin allow-scripts');
- iframe.setAttribute('src', '/');
- iframe.setAttribute('style', 'display: none');
- document.body.appendChild(iframe);
- const teardown = () => {
- // Safari crashes without a timeout.
- setTimeout(() => document.body.removeChild(iframe), 0);
- };
-
- setTimeout(() => {
- iframe.contentDocument.write(html);
-
- setTimeout(() => {
- onPrint(iframe.contentWindow, teardown);
- iframe.contentWindow.focus();
- iframe.contentWindow.print();
- }, 20);
- }, 0);
-};
diff --git a/js/packages/dapp-accounts/CreateAccount/recoveryPage.ejs b/js/packages/dapp-accounts/CreateAccount/recoveryPage.ejs
deleted file mode 100644
index 460948d7b..000000000
--- a/js/packages/dapp-accounts/CreateAccount/recoveryPage.ejs
+++ /dev/null
@@ -1,48 +0,0 @@
-
-
-
- Recovery phrase for <%= name %>
-
-
-
-
-
-
-
This is your account <%= name %>:
-
-
- <%= address %>
-
-
This is the recovery phrase:
-
<%= phrase %>
-
-
diff --git a/js/packages/dapp-accounts/CreateAccount/store.js b/js/packages/dapp-accounts/CreateAccount/store.js
deleted file mode 100644
index 13c1afb93..000000000
--- a/js/packages/dapp-accounts/CreateAccount/store.js
+++ /dev/null
@@ -1,513 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { action, computed, observable, transaction } from 'mobx';
-
-import apiutil from '@parity/api/util';
-
-import ERRORS from './errors';
-
-const FAKEPATH = 'C:\\fakepath\\';
-const STAGE_SELECT_TYPE = 0;
-const STAGE_CREATE = 1;
-const STAGE_INFO = 2;
-const STAGE_CONFIRM_BACKUP = 3;
-
-export default class Store {
- @observable accounts = null;
- @observable address = null;
- @observable createType = 'fromNew';
- @observable description = '';
- @observable gethAccountsAvailable = [];
- @observable gethAddresses = [];
- @observable gethImported = [];
- @observable isBusy = false;
- @observable isWindowsPhrase = false;
- @observable name = '';
- @observable nameError = ERRORS.noName;
- @observable password = '';
- @observable passwordHint = '';
- @observable passwordRepeat = '';
- @observable phrase = '';
- @observable backupPhraseAddress = null;
- @observable phraseBackedUp = '';
- @observable qrAddress = null;
- @observable rawKey = '';
- @observable rawKeyError = ERRORS.nokey;
- @observable stage = STAGE_SELECT_TYPE;
- @observable vaultName = '';
- @observable walletFile = '';
- @observable walletFileError = ERRORS.noFile;
- @observable walletJson = '';
-
- constructor (api, accounts, isTest, loadGeth = true) {
- this._api = api;
- this.accounts = Object.assign({}, accounts);
- this.isTest = isTest;
-
- if (loadGeth) {
- this.loadAvailableGethAccounts();
- }
- }
-
- @computed get canCreate () {
- switch (this.createType) {
- case 'fromGeth':
- return this.gethAddresses.length !== 0;
-
- case 'fromJSON':
- case 'fromPresale':
- return !(this.nameError || this.walletFileError);
-
- case 'fromNew':
- return !(this.nameError || this.passwordRepeatError) && this.hasAddress && this.hasPhrase;
-
- case 'fromPhrase':
- return !(this.nameError || this.passwordRepeatError || this.passPhraseError);
-
- case 'fromQr':
- return this.qrAddressValid && !this.nameError;
-
- case 'fromRaw':
- return !(this.nameError || this.passwordRepeatError || this.rawKeyError);
-
- default:
- return false;
- }
- }
-
- @computed get passPhraseError () {
- return !this.isTest && this.phrase.length === 0;
- }
-
- @computed get hasAddress () {
- return !!(this.address);
- }
-
- @computed get hasPhrase () {
- return this.phrase.length !== 0;
- }
-
- @computed get passwordRepeatError () {
- return this.password === this.passwordRepeat
- ? null
- : ERRORS.noMatchPassword;
- }
-
- @computed get backupPhraseError () {
- return !this.backupPhraseAddress || this.address === this.backupPhraseAddress
- ? null
- : ERRORS.noMatchBackupPhrase;
- }
-
- @computed get phraseBackedUpError () {
- return this.phraseBackedUp === 'I have written down the phrase'
- ? null
- : ERRORS.noMatchPhraseBackedUp;
- }
-
- @computed get qrAddressValid () {
- console.log('qrValid', this.qrAddress, this._api.util.isAddressValid(this.qrAddress));
- return this._api.util.isAddressValid(this.qrAddress);
- }
-
- @action clearPhrase = () => {
- transaction(() => {
- this.phrase = '';
- this.phraseBackedUp = '';
- });
- }
-
- @action clearErrors = () => {
- transaction(() => {
- this.address = '';
- this.description = '';
- this.password = '';
- this.passwordRepeat = '';
- this.phrase = '';
- this.backupPhraseAddress = null;
- this.phraseBackedUp = '';
- this.name = '';
- this.nameError = ERRORS.noName;
- this.qrAddress = null;
- this.rawKey = '';
- this.rawKeyError = null;
- this.vaultName = '';
- this.walletFile = '';
- this.walletFileError = null;
- this.walletJson = '';
- });
- }
-
- @action selectGethAccount = (address) => {
- if (this.gethAddresses.includes(address)) {
- this.gethAddresses = this.gethAddresses.filter((_address) => _address !== address);
- } else {
- this.gethAddresses = [address].concat(this.gethAddresses.peek());
- }
- }
-
- @action setAddress = (address) => {
- this.address = address;
- }
-
- @action setBusy = (isBusy) => {
- this.isBusy = isBusy;
- }
-
- @action setCreateType = (createType) => {
- this.clearErrors();
- this.createType = createType;
- }
-
- @action setDescription = (description) => {
- this.description = description;
- }
-
- @action setGethAccountsAvailable = (gethAccountsAvailable) => {
- this.gethAccountsAvailable = [].concat(gethAccountsAvailable);
- }
-
- @action setGethImported = (gethImported) => {
- this.gethImported = gethImported;
- }
-
- @action setQrAddress = (qrAddress) => {
- if (qrAddress && qrAddress.substr(0, 2) !== '0x') {
- qrAddress = `0x${qrAddress}`;
- }
-
- // FIXME: Current native signer encoding is not 100% for EIP-55, lowercase for now
- this.qrAddress = qrAddress && this._api.util
- ? this._api.util.toChecksumAddress(qrAddress.toLowerCase())
- : qrAddress;
- }
-
- @action setVaultName = (vaultName) => {
- this.vaultName = vaultName;
- }
-
- @action setWindowsPhrase = (isWindowsPhrase = false) => {
- this.isWindowsPhrase = isWindowsPhrase;
- }
-
- @action setName = (name) => {
- let nameError = null;
-
- if (!name || !name.trim().length) {
- nameError = ERRORS.noName;
- }
-
- transaction(() => {
- this.name = name;
- this.nameError = nameError;
- });
- }
-
- @action setBackupPhraseAddress = (address) => {
- this.backupPhraseAddress = address;
- }
-
- @action computeBackupPhraseAddress = () => {
- return this._api.parity.phraseToAddress(this.phrase)
- .then(address => {
- this.setBackupPhraseAddress(address);
- return address !== this.address;
- })
- .catch((error) => {
- console.error('createAccount', error);
- throw error;
- });
- }
-
- @action setPhraseBackedUp = (backedUp) => {
- this.phraseBackedUp = backedUp;
- }
-
- @action setPassword = (password) => {
- this.password = password;
- }
-
- @action setPasswordHint = (passwordHint) => {
- this.passwordHint = passwordHint;
- }
-
- @action setPasswordRepeat = (passwordRepeat) => {
- this.passwordRepeat = passwordRepeat;
- }
-
- @action setPhrase = (phrase) => {
- const recoveryPhrase = phrase
- .toLowerCase() // wordlists are lowercase
- .trim() // remove whitespace at both ends
- .replace(/\s/g, ' ') // replace any whitespace with single space
- .replace(/ +/g, ' '); // replace multiple spaces with a single space
-
- const phraseParts = recoveryPhrase
- .split(' ')
- .map((part) => part.trim())
- .filter((part) => part.length);
-
- this.phrase = phraseParts.join(' ');
- this.backupPhraseAddress = null;
- }
-
- @action setRawKey = (rawKey) => {
- let rawKeyError = null;
-
- if (!rawKey || !rawKey.trim().length) {
- rawKeyError = ERRORS.noKey;
- } else if (rawKey.substr(0, 2) !== '0x' || rawKey.substr(2).length !== 64 || !apiutil.isHex(rawKey)) {
- rawKeyError = ERRORS.invalidKey;
- }
-
- transaction(() => {
- this.rawKey = rawKey;
- this.rawKeyError = rawKeyError;
- });
- }
-
- @action setStage = (stage) => {
- this.stage = stage;
- }
-
- @action setWalletFile = (walletFile) => {
- transaction(() => {
- this.walletFile = walletFile.replace(FAKEPATH, '');
- this.walletFileError = ERRORS.noFile;
- this.walletJson = null;
- });
- }
-
- @action setWalletJson = (walletJson) => {
- transaction(() => {
- this.walletFileError = null;
- this.walletJson = walletJson;
- });
- }
-
- @action nextStage = () => {
- if (this.stage === 0) {
- this.clearErrors();
- }
-
- this.stage++;
- }
-
- @action prevStage = () => {
- this.stage--;
- }
-
- createAccount = (vaultStore) => {
- if (!this.canCreate) {
- return false;
- }
-
- this.setBusy(true);
-
- return this
- ._createAccount()
- .then(() => {
- if (vaultStore && this.vaultName && this.vaultName.length) {
- return vaultStore.moveAccount(this.vaultName, this.address);
- }
-
- return true;
- })
- .then(() => {
- this.setBusy(false);
- })
- .catch((error) => {
- this.setBusy(false);
- throw error;
- });
- }
-
- _createAccount = () => {
- switch (this.createType) {
- case 'fromGeth':
- return this.createAccountFromGeth();
-
- case 'fromJSON':
- case 'fromPresale':
- return this.createAccountFromWallet();
-
- case 'fromNew':
- case 'fromPhrase':
- return this.createAccountFromPhrase();
-
- case 'fromQr':
- return this.createAccountFromQr();
-
- case 'fromRaw':
- return this.createAccountFromRaw();
-
- default:
- throw new Error(`Cannot create account for ${this.createType}`);
- }
- }
-
- createAccountFromGeth = (timestamp = Date.now()) => {
- return this._api.parity
- .importGethAccounts(this.gethAddresses.peek())
- .then((gethImported) => {
- console.log('createAccountFromGeth', gethImported);
-
- this.setName('Geth Import');
- this.setDescription('Imported from Geth keystore');
- this.setGethImported(gethImported);
-
- return Promise.all(gethImported.map((address) => {
- return this.setupMeta(address, timestamp);
- }));
- })
- .catch((error) => {
- console.error('createAccountFromGeth', error);
- throw error;
- });
- }
-
- createAccountFromPhrase = (timestamp = Date.now()) => {
- let formattedPhrase = this.phrase;
-
- if (this.isWindowsPhrase && this.createType === 'fromPhrase') {
- formattedPhrase = this.phrase
- .split(' ') // get the words
- .map((word) => word === 'misjudged' ? word : `${word}\r`) // add \r after each (except last in dict)
- .join(' '); // re-create string
- }
-
- return this._api.parity
- .newAccountFromPhrase(formattedPhrase, this.password)
- .then((address) => {
- this.setAddress(address);
-
- return this.setupMeta(address, timestamp);
- })
- .catch((error) => {
- console.error('createAccount', error);
- throw error;
- });
- }
-
- createAccountFromQr = (timestamp = Date.now()) => {
- this.setAddress(this.qrAddress);
-
- return this.setupMeta(this.qrAddress, timestamp, { external: true });
- }
-
- createAccountFromRaw = (timestamp = Date.now()) => {
- return this._api.parity
- .newAccountFromSecret(this.rawKey, this.password)
- .then((address) => {
- this.setAddress(address);
-
- return this.setupMeta(address, timestamp);
- })
- .catch((error) => {
- console.error('createAccount', error);
- throw error;
- });
- }
-
- createAccountFromWallet = (timestamp = Date.now()) => {
- return this._api.parity
- .newAccountFromWallet(this.walletJson, this.password)
- .then((address) => {
- this.setAddress(address);
-
- return this.setupMeta(address, timestamp);
- })
- .catch((error) => {
- console.error('createAccount', error);
- throw error;
- });
- }
-
- setupMeta = (address, timestamp = Date.now(), extra = {}) => {
- const meta = Object.assign({}, extra, {
- description: this.description,
- passwordHint: this.passwordHint,
- timestamp
- });
-
- return this._api.parity
- .setAccountName(address, this.name)
- .then(() => this._api.parity.setAccountMeta(address, meta));
- }
-
- createIdentities = () => {
- return Promise
- .all([
- this._api.parity.generateSecretPhrase(),
- this._api.parity.generateSecretPhrase(),
- this._api.parity.generateSecretPhrase(),
- this._api.parity.generateSecretPhrase(),
- this._api.parity.generateSecretPhrase(),
- this._api.parity.generateSecretPhrase(),
- this._api.parity.generateSecretPhrase()
- ])
- .then((phrases) => {
- return Promise
- .all(phrases.map((phrase) => this._api.parity.phraseToAddress(phrase)))
- .then((addresses) => {
- return phrases.reduce((accounts, phrase, index) => {
- const address = addresses[index];
-
- accounts[address] = {
- address,
- phrase
- };
-
- return accounts;
- }, {});
- });
- })
- .catch((error) => {
- console.error('createIdentities', error);
- throw error;
- });
- }
-
- loadAvailableGethAccounts () {
- return this._api.parity
- .listGethAccounts()
- .then((_addresses) => {
- const addresses = (_addresses || []).filter((address) => !this.accounts[address]);
-
- return Promise
- .all(addresses.map((address) => this._api.eth.getBalance(address)))
- .then((balances) => {
- this.setGethAccountsAvailable(addresses.map((address, index) => {
- return {
- address,
- balance: apiutil.fromWei(balances[index]).toFormat(5)
- };
- }));
- });
- })
- .catch((error) => {
- console.warn('loadAvailableGethAccounts', error);
- });
- }
-}
-
-export {
- STAGE_INFO,
- STAGE_CONFIRM_BACKUP,
- STAGE_CREATE,
- STAGE_SELECT_TYPE
-};
diff --git a/js/packages/dapp-accounts/CreateAccount/store.spec.js b/js/packages/dapp-accounts/CreateAccount/store.spec.js
deleted file mode 100644
index fbb88b084..000000000
--- a/js/packages/dapp-accounts/CreateAccount/store.spec.js
+++ /dev/null
@@ -1,812 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import sinon from 'sinon';
-
-import Store from './store';
-
-import { ACCOUNTS, ADDRESS, GETH_ADDRESSES, createApi } from './createAccount.test.js';
-
-let api;
-let store;
-let vaultStore;
-
-function createVaultStore () {
- vaultStore = {
- moveAccount: sinon.stub().resolves(),
- listVaults: sinon.stub().resolves()
- };
-
- return vaultStore;
-}
-
-function createStore (loadGeth) {
- createVaultStore();
-
- api = createApi();
- store = new Store(api, ACCOUNTS, true, loadGeth);
-
- return store;
-}
-
-describe('modals/CreateAccount/Store', () => {
- beforeEach(() => {
- createStore();
- });
-
- describe('constructor', () => {
- it('captures the accounts passed', () => {
- expect(store.accounts).to.deep.equal(ACCOUNTS);
- });
-
- it('starts as non-busy', () => {
- expect(store.isBusy).to.be.false;
- });
-
- it('sets the initial createType to fromNew', () => {
- expect(store.createType).to.equal('fromNew');
- });
-
- it('sets the initial stage to create', () => {
- expect(store.stage).to.equal(0);
- });
-
- it('loads the geth accounts', () => {
- expect(store.gethAccountsAvailable.map((account) => account.address)).to.deep.equal([GETH_ADDRESSES[0]]);
- });
-
- it('does not load geth accounts when loadGeth === false', () => {
- createStore(false);
- expect(store.gethAccountsAvailable.peek()).to.deep.equal([]);
- });
- });
-
- describe('@action', () => {
- describe('clearErrors', () => {
- beforeEach(() => {
- store.setName('testing');
- store.setPassword('testing');
- store.setQrAddress('testing');
- store.setRawKey('test');
- store.setVaultName('testing');
- store.setWalletFile('test');
- store.setWalletJson('test');
- });
-
- it('clears all errors', () => {
- store.clearErrors();
-
- expect(store.name).to.equal('');
- expect(store.nameError).not.to.be.null;
- expect(store.password).to.equal('');
- expect(store.passwordRepeatError).to.be.null;
- expect(store.qrAddress).to.be.null;
- expect(store.rawKey).to.equal('');
- expect(store.rawKeyError).to.be.null;
- expect(store.vaultName).to.equal('');
- expect(store.walletFile).to.equal('');
- expect(store.walletFileError).to.be.null;
- expect(store.walletJson).to.equal('');
- });
- });
-
- describe('selectGethAccount', () => {
- it('selects and deselects and address', () => {
- expect(store.gethAddresses.peek()).to.deep.equal([]);
- store.selectGethAccount(GETH_ADDRESSES[0]);
- expect(store.gethAddresses.peek()).to.deep.equal([GETH_ADDRESSES[0]]);
- store.selectGethAccount(GETH_ADDRESSES[0]);
- expect(store.gethAddresses.peek()).to.deep.equal([]);
- });
- });
-
- describe('setAddress', () => {
- const ADDR = '0x1234567890123456789012345678901234567890';
-
- it('sets the address', () => {
- store.setAddress(ADDR);
- expect(store.address).to.equal(ADDR);
- });
- });
-
- describe('setBusy', () => {
- it('sets the busy flag', () => {
- store.setBusy(true);
- expect(store.isBusy).to.be.true;
- });
- });
-
- describe('setCreateType', () => {
- it('allows changing the type', () => {
- store.setCreateType('testing');
- expect(store.createType).to.equal('testing');
- });
- });
-
- describe('setDescription', () => {
- it('allows setting the description', () => {
- store.setDescription('testing');
- expect(store.description).to.equal('testing');
- });
- });
-
- describe('setName', () => {
- it('allows setting the name', () => {
- store.setName('testing');
- expect(store.name).to.equal('testing');
- expect(store.nameError).to.be.null;
- });
-
- it('sets errors on invalid names', () => {
- store.setName('');
- expect(store.nameError).not.to.be.null;
- });
- });
-
- describe('setPassword', () => {
- it('allows setting the password', () => {
- store.setPassword('testing');
- expect(store.password).to.equal('testing');
- });
- });
-
- describe('setPasswordHint', () => {
- it('allows setting the passwordHint', () => {
- store.setPasswordHint('testing');
- expect(store.passwordHint).to.equal('testing');
- });
- });
-
- describe('setPasswordRepeat', () => {
- it('allows setting the passwordRepeat', () => {
- store.setPasswordRepeat('testing');
- expect(store.passwordRepeat).to.equal('testing');
- });
- });
-
- describe('setPhrase', () => {
- it('allows setting the phrase', () => {
- store.setPhrase('testing');
- expect(store.phrase).to.equal('testing');
- });
- });
-
- describe('setQrAddress', () => {
- const ADDR = '0x1234567890123456789012345678901234567890';
-
- it('sets the address', () => {
- store.setQrAddress(ADDR);
- expect(store.qrAddress).to.equal(ADDR);
- });
-
- it('adds leading 0x if not found', () => {
- store.setQrAddress(ADDR.substr(2));
- expect(store.qrAddress).to.equal(ADDR);
- });
- });
-
- describe('setRawKey', () => {
- it('sets error when empty key', () => {
- store.setRawKey(null);
- expect(store.rawKeyError).not.to.be.null;
- });
-
- it('sets error when non-hex value', () => {
- store.setRawKey('0000000000000000000000000000000000000000000000000000000000000000');
- expect(store.rawKeyError).not.to.be.null;
- });
-
- it('sets error when non-valid length value', () => {
- store.setRawKey('0x0');
- expect(store.rawKeyError).not.to.be.null;
- });
-
- it('sets the key when checks pass', () => {
- const KEY = '0x1000000000000000000000000000000000000000000000000000000000000000';
-
- store.setRawKey(KEY);
- expect(store.rawKey).to.equal(KEY);
- expect(store.rawKeyError).to.be.null;
- });
- });
-
- describe('setStage', () => {
- it('changes to the provided stage', () => {
- store.setStage(2);
- expect(store.stage).to.equal(2);
- });
- });
-
- describe('setVaultName', () => {
- it('sets the vault name', () => {
- store.setVaultName('testVault');
- expect(store.vaultName).to.equal('testVault');
- });
- });
-
- describe('setWalletFile', () => {
- it('sets the filepath', () => {
- store.setWalletFile('testing');
- expect(store.walletFile).to.equal('testing');
- });
-
- it('cleans up the fakepath', () => {
- store.setWalletFile('C:\\fakepath\\testing');
- expect(store.walletFile).to.equal('testing');
- });
-
- it('sets the error', () => {
- store.setWalletFile('testing');
- expect(store.walletFileError).not.to.be.null;
- });
- });
-
- describe('setWalletJson', () => {
- it('sets the json', () => {
- store.setWalletJson('testing');
- expect(store.walletJson).to.equal('testing');
- });
-
- it('clears previous file errors', () => {
- store.setWalletFile('testing');
- store.setWalletJson('testing');
- expect(store.walletFileError).to.be.null;
- });
- });
-
- describe('setWindowsPhrase', () => {
- it('allows setting the windows toggle', () => {
- store.setWindowsPhrase(true);
- expect(store.isWindowsPhrase).to.be.true;
- });
- });
-
- describe('nextStage/prevStage', () => {
- it('changes to next/prev', () => {
- expect(store.stage).to.equal(0);
- store.nextStage();
- expect(store.stage).to.equal(1);
- store.prevStage();
- expect(store.stage).to.equal(0);
- });
- });
- });
-
- describe('@computed', () => {
- describe('canCreate', () => {
- beforeEach(() => {
- store.clearErrors();
- });
-
- describe('createType === fromGeth', () => {
- beforeEach(() => {
- store.setCreateType('fromGeth');
- });
-
- it('returns false on none selected', () => {
- expect(store.canCreate).to.be.false;
- });
-
- it('returns true when selected', () => {
- store.selectGethAccount(GETH_ADDRESSES[0]);
- expect(store.canCreate).to.be.true;
- });
- });
-
- describe('createType === fromJSON/fromPresale', () => {
- beforeEach(() => {
- store.setCreateType('fromJSON');
- store.setName('blah');
- });
-
- it('returns true on no errors', () => {
- expect(store.canCreate).to.be.true;
- });
-
- it('returns false on nameError', () => {
- store.setName('');
- expect(store.canCreate).to.be.false;
- });
-
- it('returns false on walletFileError', () => {
- store.setWalletFile('testing');
- expect(store.canCreate).to.be.false;
- });
- });
-
- describe('createType === fromNew', () => {
- beforeEach(() => {
- store.setCreateType('fromNew');
- store.setAddress('0x0000000000000000000000000000000000000000');
- store.setName('blah');
- store.setPhrase('testing');
- });
-
- it('returns true on no errors', () => {
- expect(store.canCreate).to.be.true;
- });
-
- it('returns false on nameError', () => {
- store.setName('');
-
- expect(store.canCreate).to.be.false;
- });
-
- it('returns false on no phrase', () => {
- store.setPhrase('');
-
- expect(store.canCreate).to.be.false;
- });
-
- it('returns false on passwordRepeatError', () => {
- store.setPassword('testing');
-
- expect(store.canCreate).to.be.false;
- });
- });
-
- describe('createType === fromPhrase', () => {
- beforeEach(() => {
- store.setCreateType('fromPhrase');
- store.setName('name');
- });
-
- it('returns true on no errors', () => {
- expect(store.canCreate).to.be.true;
- });
-
- it('returns false on nameError', () => {
- store.setName('');
- expect(store.canCreate).to.be.false;
- });
-
- it('returns false on passwordRepeatError', () => {
- store.setPassword('testing');
- expect(store.canCreate).to.be.false;
- });
- });
-
- describe('createType === fromRaw', () => {
- beforeEach(() => {
- store.setCreateType('fromRaw');
- store.setName('name');
- store.setRawKey('0x1000000000000000000000000000000000000000000000000000000000000000');
- });
-
- it('returns true on no errors', () => {
- expect(store.canCreate).to.be.true;
- });
-
- it('returns false on nameError', () => {
- store.setName('');
- expect(store.canCreate).to.be.false;
- });
-
- it('returns false on passwordRepeatError', () => {
- store.setPassword('testing');
- expect(store.canCreate).to.be.false;
- });
-
- it('returns false on rawKeyError', () => {
- store.setRawKey('0x1');
- expect(store.canCreate).to.be.false;
- });
- });
-
- describe('createType === anythingElse', () => {
- beforeEach(() => {
- store.setCreateType('anythingElse');
- });
-
- it('always returns false', () => {
- expect(store.canCreate).to.be.false;
- });
- });
- });
-
- describe('passwordRepeatError', () => {
- it('is clear when passwords match', () => {
- store.setPassword('testing');
- store.setPasswordRepeat('testing');
- expect(store.passwordRepeatError).to.be.null;
- });
-
- it('has error when passwords does not match', () => {
- store.setPassword('testing');
- store.setPasswordRepeat('testing2');
- expect(store.passwordRepeatError).not.to.be.null;
- });
- });
- });
-
- describe('operations', () => {
- describe('setupMeta', () => {
- beforeEach(() => {
- store.setDescription('test description');
- store.setName('test name');
- store.setPasswordHint('some hint');
-
- return store.setupMeta('testaddr', 'timestamp', { something: 'else' });
- });
-
- it('sets the name for the acocunt', () => {
- expect(api.parity.setAccountName).to.have.been.calledWith('testaddr', 'test name');
- });
-
- it('sets the meta for the account', () => {
- expect(api.parity.setAccountMeta).to.have.been.calledWith('testaddr', {
- description: 'test description',
- passwordHint: 'some hint',
- something: 'else',
- timestamp: 'timestamp'
- });
- });
- });
-
- describe('createAccount', () => {
- let createAccountFromGethSpy;
- let createAccountFromWalletSpy;
- let createAccountFromPhraseSpy;
- let createAccountFromQrSpy;
- let createAccountFromRawSpy;
- let busySpy;
-
- beforeEach(() => {
- createAccountFromGethSpy = sinon.spy(store, 'createAccountFromGeth');
- createAccountFromWalletSpy = sinon.spy(store, 'createAccountFromWallet');
- createAccountFromPhraseSpy = sinon.spy(store, 'createAccountFromPhrase');
- createAccountFromQrSpy = sinon.spy(store, 'createAccountFromQr');
- createAccountFromRawSpy = sinon.spy(store, 'createAccountFromRaw');
- busySpy = sinon.spy(store, 'setBusy');
-
- store.setName('name');
- store.setPhrase('testing');
- });
-
- afterEach(() => {
- store.createAccountFromGeth.restore();
- store.createAccountFromWallet.restore();
- store.createAccountFromPhrase.restore();
- store.createAccountFromRaw.restore();
- store.createAccountFromQr.restore();
- store.setBusy.restore();
- });
-
- it('throws error on invalid createType', () => {
- store.setCreateType('testing');
- expect(() => store.createAccount()).to.throw;
- });
-
- it('calls createAccountFromGeth on createType === fromGeth', () => {
- store.setCreateType('fromGeth');
- store.setGethAccountsAvailable(GETH_ADDRESSES);
- store.selectGethAccount(GETH_ADDRESSES[0]);
-
- return store.createAccount().then(() => {
- expect(createAccountFromGethSpy).to.have.been.called;
- });
- });
-
- it('calls createAccountFromWallet on createType === fromJSON', () => {
- store.setCreateType('fromJSON');
- store.setName('name');
- store.setWalletJson('{}');
-
- return store.createAccount().then(() => {
- expect(createAccountFromWalletSpy).to.have.been.called;
- });
- });
-
- it('calls createAccountFromPhrase on createType === fromNew', () => {
- store.setCreateType('fromNew');
- store.setName('name');
- store.setPhrase('phrase');
- store.setAddress('0x1234567890123456789012345678901234567890');
-
- return store.createAccount().then(() => {
- expect(createAccountFromPhraseSpy).to.have.been.called;
- });
- });
-
- it('calls createAccountFromPhrase on createType === fromPhrase', () => {
- store.setCreateType('fromPhrase');
- store.setName('name');
- store.setPhrase('phrase');
- store.setAddress('0x1234567890123456789012345678901234567890');
-
- return store.createAccount().then(() => {
- expect(createAccountFromPhraseSpy).to.have.been.called;
- });
- });
-
- it('calls createAccountFromWallet on createType === fromPresale', () => {
- store.setCreateType('fromPresale');
- store.setName('name');
- store.setWalletJson('{}');
-
- return store.createAccount().then(() => {
- expect(createAccountFromWalletSpy).to.have.been.called;
- });
- });
-
- it('calls createAccountFromQr on createType === fromQr', () => {
- store.setCreateType('fromQr');
- store.setQrAddress('0x1234567890123456789012345678901234567890');
- store.setName('name');
-
- return store.createAccount().then(() => {
- expect(createAccountFromQrSpy).to.have.been.called;
- });
- });
-
- it('calls createAccountFromRaw on createType === fromRaw', () => {
- store.setCreateType('fromRaw');
- store.setName('name');
- store.setRawKey('0x1000000000000000000000000000000000000000000000000000000000000000');
-
- return store.createAccount().then(() => {
- expect(createAccountFromRawSpy).to.have.been.called;
- });
- });
-
- it('moves account to vault when vaultName set', () => {
- store.setCreateType('fromNew');
- store.setVaultName('testing');
- store.setName('name');
- store.setAddress('0x1234567890123456789012345678901234567890');
- store.setPhrase('phrase');
-
- return store.createAccount(vaultStore).then(() => {
- expect(vaultStore.moveAccount).to.have.been.calledWith('testing', ADDRESS);
- });
- });
-
- it('sets and rests the busy flag', () => {
- store.setCreateType('fromNew');
- store.setName('name');
- store.setAddress('0x1234567890123456789012345678901234567890');
- store.setPhrase('phrase');
-
- return store.createAccount().then(() => {
- expect(busySpy).to.have.been.calledWith(true);
- expect(busySpy).to.have.been.calledWith(false);
- });
- });
-
- describe('createAccountFromGeth', () => {
- beforeEach(() => {
- store.selectGethAccount(GETH_ADDRESSES[0]);
- });
-
- it('calls parity.importGethAccounts', () => {
- return store.createAccountFromGeth().then(() => {
- expect(store._api.parity.importGethAccounts).to.have.been.calledWith([GETH_ADDRESSES[0]]);
- });
- });
-
- it('sets the account name', () => {
- return store.createAccountFromGeth().then(() => {
- expect(store._api.parity.setAccountName).to.have.been.calledWith(GETH_ADDRESSES[0], 'Geth Import');
- });
- });
-
- it('sets the account meta', () => {
- return store.createAccountFromGeth(-1).then(() => {
- expect(store._api.parity.setAccountMeta).to.have.been.calledWith(GETH_ADDRESSES[0], {
- description: 'Imported from Geth keystore',
- passwordHint: '',
- timestamp: -1
- });
- });
- });
- });
-
- describe('createAccountFromPhrase', () => {
- beforeEach(() => {
- store.setCreateType('fromPhrase');
- store.setName('some name');
- store.setPassword('P@55worD');
- store.setPasswordHint('some hint');
- store.setPhrase('some phrase');
- });
-
- it('calls parity.newAccountFromWallet', () => {
- return store.createAccountFromPhrase().then(() => {
- expect(store._api.parity.newAccountFromPhrase).to.have.been.calledWith('some phrase', 'P@55worD');
- });
- });
-
- it('sets the address', () => {
- return store.createAccountFromPhrase().then(() => {
- expect(store.address).to.equal(ADDRESS);
- });
- });
-
- it('sets the account name', () => {
- return store.createAccountFromPhrase().then(() => {
- expect(store._api.parity.setAccountName).to.have.been.calledWith(ADDRESS, 'some name');
- });
- });
-
- it('sets the account meta', () => {
- return store.createAccountFromPhrase(-1).then(() => {
- expect(store._api.parity.setAccountMeta).to.have.been.calledWith(ADDRESS, {
- description: '',
- passwordHint: 'some hint',
- timestamp: -1
- });
- });
- });
-
- it('adjusts phrases for Windows', () => {
- store.setWindowsPhrase(true);
- return store.createAccountFromPhrase().then(() => {
- expect(store._api.parity.newAccountFromPhrase).to.have.been.calledWith('some\r phrase\r', 'P@55worD');
- });
- });
-
- it('adjusts phrases for Windows (except last word)', () => {
- store.setWindowsPhrase(true);
- store.setPhrase('misjudged phrase');
- return store.createAccountFromPhrase().then(() => {
- expect(store._api.parity.newAccountFromPhrase).to.have.been.calledWith('misjudged phrase\r', 'P@55worD');
- });
- });
- });
-
- describe('createAccountFromQr', () => {
- beforeEach(() => {
- store.setName('some name');
- store.setDescription('some desc');
- store.setQrAddress('0x1234567890123456789012345678901234567890');
- sinon.spy(store, 'setupMeta');
-
- return store.createAccountFromQr(-1);
- });
-
- afterEach(() => {
- store.setupMeta.restore();
- });
-
- it('sets the meta', () => {
- expect(store.setupMeta).to.have.been.called;
- });
- });
-
- describe('createAccountFromRaw', () => {
- beforeEach(() => {
- store.setName('some name');
- store.setPassword('P@55worD');
- store.setPasswordHint('some hint');
- store.setRawKey('rawKey');
- });
-
- it('calls parity.newAccountFromSecret', () => {
- return store.createAccountFromRaw().then(() => {
- expect(store._api.parity.newAccountFromSecret).to.have.been.calledWith('rawKey', 'P@55worD');
- });
- });
-
- it('sets the address', () => {
- return store.createAccountFromRaw().then(() => {
- expect(store.address).to.equal(ADDRESS);
- });
- });
-
- it('sets the account name', () => {
- return store.createAccountFromRaw().then(() => {
- expect(store._api.parity.setAccountName).to.have.been.calledWith(ADDRESS, 'some name');
- });
- });
-
- it('sets the account meta', () => {
- return store.createAccountFromRaw(-1).then(() => {
- expect(store._api.parity.setAccountMeta).to.have.been.calledWith(ADDRESS, {
- description: '',
- passwordHint: 'some hint',
- timestamp: -1
- });
- });
- });
- });
-
- describe('createAccountFromWallet', () => {
- beforeEach(() => {
- store.setName('some name');
- store.setPassword('P@55worD');
- store.setPasswordHint('some hint');
- store.setWalletJson('json');
- });
-
- it('calls parity.newAccountFromWallet', () => {
- return store.createAccountFromWallet().then(() => {
- expect(store._api.parity.newAccountFromWallet).to.have.been.calledWith('json', 'P@55worD');
- });
- });
-
- it('sets the address', () => {
- return store.createAccountFromWallet().then(() => {
- expect(store.address).to.equal(ADDRESS);
- });
- });
-
- it('sets the account name', () => {
- return store.createAccountFromWallet().then(() => {
- expect(store._api.parity.setAccountName).to.have.been.calledWith(ADDRESS, 'some name');
- });
- });
-
- it('sets the account meta', () => {
- return store.createAccountFromWallet(-1).then(() => {
- expect(store._api.parity.setAccountMeta).to.have.been.calledWith(ADDRESS, {
- description: '',
- passwordHint: 'some hint',
- timestamp: -1
- });
- });
- });
- });
- });
-
- describe('createIdentities', () => {
- it('creates calls parity.generateSecretPhrase', () => {
- return store.createIdentities().then(() => {
- expect(store._api.parity.generateSecretPhrase).to.have.been.called;
- });
- });
-
- it('returns a map of 7 accounts', () => {
- return store.createIdentities().then((accounts) => {
- expect(Object.keys(accounts).length).to.equal(7);
- });
- });
-
- it('creates accounts with an address & phrase', () => {
- return store.createIdentities().then((accounts) => {
- Object.keys(accounts).forEach((address) => {
- const account = accounts[address];
-
- expect(account.address).to.equal(address);
- expect(account.phrase).to.be.ok;
- });
- });
- });
- });
-
- describe('loadAvailableGethAccounts', () => {
- it('retrieves the list from parity.listGethAccounts', () => {
- return store.loadAvailableGethAccounts().then(() => {
- expect(store._api.parity.listGethAccounts).to.have.been.called;
- });
- });
-
- it('sets the available addresses with balances', () => {
- return store.loadAvailableGethAccounts().then(() => {
- expect(store.gethAccountsAvailable[0]).to.deep.equal({
- address: GETH_ADDRESSES[0],
- balance: '0.00000'
- });
- });
- });
-
- it('filters accounts already available', () => {
- return store.loadAvailableGethAccounts().then(() => {
- expect(store.gethAccountsAvailable.length).to.equal(1);
- });
- });
- });
- });
-});
diff --git a/js/packages/dapp-accounts/CreateWallet/WalletDetails/index.js b/js/packages/dapp-accounts/CreateWallet/WalletDetails/index.js
deleted file mode 100644
index e572ba22b..000000000
--- a/js/packages/dapp-accounts/CreateWallet/WalletDetails/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './walletDetails';
diff --git a/js/packages/dapp-accounts/CreateWallet/WalletDetails/walletDetails.js b/js/packages/dapp-accounts/CreateWallet/WalletDetails/walletDetails.js
deleted file mode 100644
index 1086ce773..000000000
--- a/js/packages/dapp-accounts/CreateWallet/WalletDetails/walletDetails.js
+++ /dev/null
@@ -1,252 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-
-import { Form, TypedInput, Input, AddressSelect, InputAddress } from '@parity/ui';
-
-import styles from '../createWallet.css';
-
-export default class WalletDetails extends Component {
- static propTypes = {
- accounts: PropTypes.object.isRequired,
- wallet: PropTypes.object.isRequired,
- errors: PropTypes.object.isRequired,
- onChange: PropTypes.func.isRequired,
- walletType: PropTypes.string.isRequired
- };
-
- render () {
- const { walletType } = this.props;
-
- if (walletType === 'WATCH') {
- return this.renderWatchDetails();
- }
-
- return this.renderMultisigDetails();
- }
-
- renderWatchDetails () {
- const { wallet, errors } = this.props;
-
- return (
-
- );
- }
-
- renderMultisigDetails () {
- const { accounts, wallet, errors } = this.props;
-
- return (
-
- );
- }
-
- onAddressChange = (_, address) => {
- this.props.onChange({ address });
- }
-
- onAccoutChange = (_, account) => {
- this.props.onChange({ account });
- }
-
- onNameChange = (_, name) => {
- this.props.onChange({ name });
- }
-
- onDescriptionChange = (_, description) => {
- this.props.onChange({ description });
- }
-
- onOwnersChange = (owners) => {
- this.props.onChange({ owners });
- }
-
- onRequiredChange = (required) => {
- this.props.onChange({ required });
- }
-
- onDaylimitChange = (daylimit) => {
- this.props.onChange({ daylimit });
- }
-}
diff --git a/js/packages/dapp-accounts/CreateWallet/WalletDetails/walletDetails.spec.js b/js/packages/dapp-accounts/CreateWallet/WalletDetails/walletDetails.spec.js
deleted file mode 100644
index 6518e6893..000000000
--- a/js/packages/dapp-accounts/CreateWallet/WalletDetails/walletDetails.spec.js
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { shallow } from 'enzyme';
-import React from 'react';
-import sinon from 'sinon';
-
-import WalletDetails from './';
-
-import { ACCOUNTS } from '../createWallet.test.js';
-
-let component;
-let onChange;
-
-function render (walletType = 'MULTISIG') {
- onChange = sinon.stub();
- component = shallow(
-
- );
-
- return component;
-}
-
-describe('WalletDetails', () => {
- it('renders defaults', () => {
- expect(render()).to.be.ok;
- });
-});
diff --git a/js/packages/dapp-accounts/CreateWallet/WalletInfo/index.js b/js/packages/dapp-accounts/CreateWallet/WalletInfo/index.js
deleted file mode 100644
index 4817ad8dc..000000000
--- a/js/packages/dapp-accounts/CreateWallet/WalletInfo/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './walletInfo';
diff --git a/js/packages/dapp-accounts/CreateWallet/WalletInfo/walletInfo.js b/js/packages/dapp-accounts/CreateWallet/WalletInfo/walletInfo.js
deleted file mode 100644
index 6aa49eb17..000000000
--- a/js/packages/dapp-accounts/CreateWallet/WalletInfo/walletInfo.js
+++ /dev/null
@@ -1,160 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-
-import { fromWei } from '@parity/api/util/wei';
-import { CompletedStep, IdentityIcon, CopyToClipboard } from '@parity/ui';
-
-import styles from '../createWallet.css';
-
-export default class WalletInfo extends Component {
- static propTypes = {
- accounts: PropTypes.object.isRequired,
- account: PropTypes.string.isRequired,
- name: PropTypes.string.isRequired,
- address: PropTypes.string.isRequired,
- owners: PropTypes.array.isRequired,
- required: PropTypes.oneOfType([
- PropTypes.string,
- PropTypes.object,
- PropTypes.number
- ]).isRequired,
- daylimit: PropTypes.oneOfType([
- PropTypes.string,
- PropTypes.object,
- PropTypes.number
- ]).isRequired,
-
- deployed: PropTypes.bool
- };
-
- render () {
- const { address, required, daylimit, name, deployed } = this.props;
-
- return (
-
-
- );
- });
- }
-
- addressToString (address) {
- const { accounts } = this.props;
-
- if (accounts[address]) {
- return accounts[address].name || address;
- }
-
- return address;
- }
-}
diff --git a/js/packages/dapp-accounts/CreateWallet/WalletInfo/walletInfo.spec.js b/js/packages/dapp-accounts/CreateWallet/WalletInfo/walletInfo.spec.js
deleted file mode 100644
index 9237659b0..000000000
--- a/js/packages/dapp-accounts/CreateWallet/WalletInfo/walletInfo.spec.js
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { shallow } from 'enzyme';
-import React from 'react';
-
-import WalletInfo from './';
-
-import { ACCOUNTS } from '../createWallet.test.js';
-
-let component;
-
-function render () {
- component = shallow(
-
- );
-
- return component;
-}
-
-describe('WalletInfo', () => {
- it('renders defaults', () => {
- expect(render()).to.be.ok;
- });
-});
diff --git a/js/packages/dapp-accounts/CreateWallet/WalletType/index.js b/js/packages/dapp-accounts/CreateWallet/WalletType/index.js
deleted file mode 100644
index 5f3d8b1db..000000000
--- a/js/packages/dapp-accounts/CreateWallet/WalletType/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './walletType.js';
diff --git a/js/packages/dapp-accounts/CreateWallet/WalletType/walletType.js b/js/packages/dapp-accounts/CreateWallet/WalletType/walletType.js
deleted file mode 100644
index 4cad6456d..000000000
--- a/js/packages/dapp-accounts/CreateWallet/WalletType/walletType.js
+++ /dev/null
@@ -1,89 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-
-import { walletSourceURL } from '@parity/shared/contracts/code/wallet';
-import { RadioButtons } from '@parity/ui';
-
-const TYPES = [
- {
- label: (
-
- ),
- key: 'MULTISIG',
- description: (
-
-
-
- )
- } }
- />
- )
- },
- {
- label: (
-
- ),
- key: 'WATCH',
- description: (
-
- )
- }
-];
-
-export default class WalletType extends Component {
- static propTypes = {
- onChange: PropTypes.func.isRequired,
- type: PropTypes.string.isRequired
- };
-
- render () {
- const { type } = this.props;
-
- return (
-
- );
- }
-
- onTypeChange = (event, type) => {
- this.props.onChange(type);
- }
-}
diff --git a/js/packages/dapp-accounts/CreateWallet/WalletType/walletType.spec.js b/js/packages/dapp-accounts/CreateWallet/WalletType/walletType.spec.js
deleted file mode 100644
index 2c9d56220..000000000
--- a/js/packages/dapp-accounts/CreateWallet/WalletType/walletType.spec.js
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { shallow } from 'enzyme';
-import React from 'react';
-import sinon from 'sinon';
-
-import WalletType from './';
-
-let component;
-let onChange;
-
-function render (walletType = 'MULTISIG') {
- onChange = sinon.stub();
- component = shallow(
-
- );
-
- return component;
-}
-
-describe('WalletType', () => {
- it('renders defaults', () => {
- expect(render()).to.be.ok;
- });
-});
diff --git a/js/packages/dapp-accounts/CreateWallet/createWallet.css b/js/packages/dapp-accounts/CreateWallet/createWallet.css
deleted file mode 100644
index 1c0ac525b..000000000
--- a/js/packages/dapp-accounts/CreateWallet/createWallet.css
+++ /dev/null
@@ -1,58 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.address {
- vertical-align: top;
- display: inline-block;
-}
-
-.identityicon {
- margin: -8px 0.5em;
-}
-
-.owner {
- height: 40px;
- color: lightgrey;
-
- display: flex;
- align-items: center;
- justify-content: center;
-
- .identityicon {
- width: 24px;
- height: 24px;
- }
-}
-
-.splitInput {
- display: flex;
- flex-direction: row;
-
- > * {
- flex: 1;
-
- margin: 0 0.25em;
-
- &:first-child {
- margin-left: 0;
- }
-
- &:last-child {
- margin-right: 0;
- }
- }
-}
diff --git a/js/packages/dapp-accounts/CreateWallet/createWallet.js b/js/packages/dapp-accounts/CreateWallet/createWallet.js
deleted file mode 100644
index 3c07c7ce7..000000000
--- a/js/packages/dapp-accounts/CreateWallet/createWallet.js
+++ /dev/null
@@ -1,206 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { observer } from 'mobx-react';
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-import { connect } from 'react-redux';
-import { bindActionCreators } from 'redux';
-
-import { setRequest } from '@parity/shared/redux/providers/requestsActions';
-import { Button, Portal } from '@parity/ui';
-import { CancelIcon, DoneIcon, NextIcon } from '@parity/ui/Icons';
-
-import WalletType from './WalletType';
-import WalletDetails from './WalletDetails';
-import WalletInfo from './WalletInfo';
-import CreateWalletStore from './createWalletStore';
-
-@observer
-export class CreateWallet extends Component {
- static contextTypes = {
- api: PropTypes.object.isRequired
- };
-
- static propTypes = {
- accounts: PropTypes.object.isRequired,
- onClose: PropTypes.func.isRequired,
- onSetRequest: PropTypes.func.isRequired
- };
-
- store = new CreateWalletStore(this.context.api, this.props);
-
- render () {
- const { stage, steps } = this.store;
-
- return (
- step.title) }
- >
- { this.renderPage() }
-
- );
- }
-
- renderPage () {
- const { step } = this.store;
- const { accounts } = this.props;
-
- switch (step) {
- case 'INFO':
- return (
-
- );
-
- case 'DETAILS':
- return (
-
- );
-
- default:
- case 'TYPE':
- return (
-
- );
- }
- }
-
- renderDialogActions () {
- const { step, hasErrors, onCreate, onNext, onAdd } = this.store;
-
- const cancelBtn = (
- }
- key='cancel'
- label={
-
- }
- onClick={ this.onClose }
- />
- );
-
- const doneBtn = (
- }
- key='done'
- label={
-
- }
- onClick={ this.onClose }
- />
- );
-
- const nextBtn = (
- }
- key='next'
- label={
-
- }
- onClick={ onNext }
- />
- );
-
- switch (step) {
- case 'INFO':
- return [ doneBtn ];
-
- case 'DETAILS':
- if (this.store.walletType === 'WATCH') {
- return [ cancelBtn, (
- }
- key='add'
- label={
-
- }
- onClick={ onAdd }
- />
- ) ];
- }
-
- return [ cancelBtn, (
- }
- key='create'
- label={
-
- }
- onClick={ onCreate }
- />
- ) ];
-
- default:
- case 'TYPE':
- return [ cancelBtn, nextBtn ];
- }
- }
-
- onClose = () => {
- this.props.onClose();
- }
-}
-
-function mapDispatchToProps (dispatch) {
- return bindActionCreators({
- onSetRequest: setRequest
- }, dispatch);
-}
-
-export default connect(
- null,
- mapDispatchToProps
-)(CreateWallet);
diff --git a/js/packages/dapp-accounts/CreateWallet/createWallet.spec.js b/js/packages/dapp-accounts/CreateWallet/createWallet.spec.js
deleted file mode 100644
index e38174b81..000000000
--- a/js/packages/dapp-accounts/CreateWallet/createWallet.spec.js
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { shallow } from 'enzyme';
-import React from 'react';
-import sinon from 'sinon';
-
-import { CreateWallet } from './createWallet';
-
-import { ACCOUNTS } from './createWallet.test.js';
-
-let api;
-let component;
-let onClose;
-
-function createApi () {
- api = {
- parity: {
- getNewDappsDefaultAddress: sinon.stub().resolves('')
- }
- };
-
- return api;
-}
-
-function render () {
- onClose = sinon.stub();
- component = shallow(
- ,
- {
- context: { api: createApi() }
- }
- );
-
- return component;
-}
-
-describe('modals/CreateWallet', () => {
- it('renders defaults', () => {
- expect(render()).to.be.ok;
- });
-});
diff --git a/js/packages/dapp-accounts/CreateWallet/createWallet.test.js b/js/packages/dapp-accounts/CreateWallet/createWallet.test.js
deleted file mode 100644
index e034bd066..000000000
--- a/js/packages/dapp-accounts/CreateWallet/createWallet.test.js
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-const ACCOUNTS = {
- '0x1234567890123456789012345678901234567890': {
- address: '0x1234567890123456789012345678901234567890'
- }
-};
-
-export {
- ACCOUNTS
-};
diff --git a/js/packages/dapp-accounts/CreateWallet/createWalletStore.js b/js/packages/dapp-accounts/CreateWallet/createWalletStore.js
deleted file mode 100644
index 3f317efa3..000000000
--- a/js/packages/dapp-accounts/CreateWallet/createWalletStore.js
+++ /dev/null
@@ -1,297 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { noop } from 'lodash';
-import { observable, computed, action, transaction } from 'mobx';
-import React from 'react';
-import { FormattedMessage } from 'react-intl';
-
-import Contract from '@parity/api/contract';
-import { toWei } from '@parity/api/util/wei';
-import Contracts from '@parity/shared/contracts';
-import { wallet as walletAbi } from '@parity/shared/contracts/abi';
-import { wallet as walletCode, walletLibrary as walletLibraryCode, walletLibraryRegKey, fullWalletCode } from '@parity/shared/contracts/code/wallet';
-import { validateUint, validateAddress, validateName } from '@parity/shared/util/validation';
-import { deploy } from '@parity/shared/util/tx';
-import WalletsUtils from '@parity/shared/util/wallets';
-
-const STEPS = {
- TYPE: {
- title: (
-
- )
- },
- DETAILS: {
- title: (
-
- )
- },
- INFO: {
- title: (
-
- )
- }
-};
-
-export default class CreateWalletStore {
- @observable step = null;
- @observable txhash = null;
- @observable walletType = 'MULTISIG';
-
- @observable wallet = {
- account: '',
- address: '',
- owners: [],
- required: 1,
- daylimit: toWei(1),
-
- name: '',
- description: ''
- };
-
- @observable errors = {
- account: null,
- address: null,
- owners: null,
- required: null,
- daylimit: null,
- name: null
- };
-
- onClose = noop;
- onSetRequest = noop;
-
- @computed get stage () {
- return this.stepsKeys.findIndex((k) => k === this.step);
- }
-
- @computed get hasErrors () {
- return !!Object.keys(this.errors)
- .filter((errorKey) => {
- if (this.walletType === 'WATCH') {
- return ['address', 'name'].includes(errorKey);
- }
-
- return errorKey !== 'address';
- })
- .find((key) => !!this.errors[key]);
- }
-
- @computed get stepsKeys () {
- return this.steps.map((s) => s.key);
- }
-
- @computed get steps () {
- return Object
- .keys(STEPS)
- .map((key) => {
- return {
- ...STEPS[key],
- key
- };
- })
- .filter((step) => this.walletType === 'WATCH' || step.key !== 'INFO');
- }
-
- constructor (api, { accounts, onClose, onSetRequest }) {
- this.api = api;
-
- this.step = this.stepsKeys[0];
- this.wallet.account = Object.values(accounts)[0].address;
- this.validateWallet(this.wallet);
- this.onClose = onClose;
- this.onSetRequest = onSetRequest;
- }
-
- @action onTypeChange = (type) => {
- this.walletType = type;
- this.validateWallet(this.wallet);
- }
-
- @action onNext = () => {
- const stepIndex = this.stepsKeys.findIndex((k) => k === this.step) + 1;
-
- this.step = this.stepsKeys[stepIndex];
- }
-
- @action onChange = (_wallet) => {
- const newWallet = Object.assign({}, this.wallet, _wallet);
-
- this.validateWallet(newWallet);
- }
-
- @action onAdd = () => {
- if (this.hasErrors) {
- return;
- }
-
- const walletContract = new Contract(this.api, walletAbi).at(this.wallet.address);
-
- return Promise
- .all([
- WalletsUtils.fetchRequire(walletContract),
- WalletsUtils.fetchOwners(walletContract),
- WalletsUtils.fetchDailylimit(walletContract)
- ])
- .then(([ require, owners, dailylimit ]) => {
- transaction(() => {
- this.wallet.owners = owners;
- this.wallet.required = require.toNumber();
- this.wallet.dailylimit = dailylimit.limit;
-
- this.wallet = this.getWalletWithMeta(this.wallet);
- });
-
- return this.addWallet(this.wallet);
- });
- }
-
- @action onCreate = () => {
- if (this.hasErrors) {
- return;
- }
-
- const { account, owners, required, daylimit } = this.wallet;
-
- Contracts
- .get()
- .registry
- .lookupAddress(walletLibraryRegKey)
- .catch(() => {
- return null; // exception when registry is not available
- })
- .then((address) => {
- console.warn('WalletLibrary address in registry', address);
-
- if (!address || /^(0x)?0*$/.test(address)) {
- return null;
- }
-
- // Check that it's actually the expected code
- return this.api.eth
- .getCode(address)
- .then((code) => {
- const strippedCode = code.replace(/^0x/, '');
-
- // The actual deployed code is included in the wallet
- // library code (which might have some more data)
- if (walletLibraryCode.indexOf(strippedCode) >= 0) {
- return address;
- }
-
- return null;
- });
- })
- .then((address) => {
- let code = fullWalletCode;
-
- if (address) {
- const walletLibraryAddress = address.replace(/^0x/, '').toLowerCase();
-
- code = walletCode.replace(/(_)+WalletLibrary(_)+/g, walletLibraryAddress);
- } else {
- console.warn('wallet library has not been found in the registry');
- }
-
- const options = {
- data: code,
- from: account
- };
-
- const contract = this.api.newContract(walletAbi);
-
- this.wallet = this.getWalletWithMeta(this.wallet);
- this.onClose();
- return deploy(contract, options, [ owners, required, daylimit ])
- .then((requestId) => {
- const metadata = { ...this.wallet.metadata, deployment: true };
-
- this.onSetRequest(requestId, { metadata }, false);
- });
- });
- }
-
- @action addWallet = (wallet) => {
- const { address, name, metadata } = wallet;
-
- return Promise
- .all([
- this.api.parity.setAccountName(address, name),
- this.api.parity.setAccountMeta(address, metadata)
- ])
- .then(() => {
- this.step = 'INFO';
- });
- }
-
- getWalletWithMeta = (wallet) => {
- const { name, description } = wallet;
-
- const metadata = {
- abi: walletAbi,
- wallet: true,
- timestamp: Date.now(),
- deleted: false,
- tags: [ 'wallet' ],
- description,
- name
- };
-
- return {
- ...wallet,
- metadata
- };
- }
-
- @action validateWallet = (_wallet) => {
- const addressValidation = validateAddress(_wallet.address);
- const accountValidation = validateAddress(_wallet.account);
- const requiredValidation = validateUint(_wallet.required);
- const daylimitValidation = validateUint(_wallet.daylimit);
- const nameValidation = validateName(_wallet.name);
-
- const errors = {
- address: addressValidation.addressError,
- account: accountValidation.addressError,
- required: requiredValidation.valueError,
- daylimit: daylimitValidation.valueError,
- name: nameValidation.nameError
- };
-
- const wallet = {
- ..._wallet,
- address: addressValidation.address,
- account: accountValidation.address,
- required: requiredValidation.value,
- daylimit: daylimitValidation.value,
- name: nameValidation.name
- };
-
- transaction(() => {
- this.wallet = wallet;
- this.errors = errors;
- });
- }
-}
diff --git a/js/packages/dapp-accounts/CreateWallet/index.js b/js/packages/dapp-accounts/CreateWallet/index.js
deleted file mode 100644
index d38d27eb8..000000000
--- a/js/packages/dapp-accounts/CreateWallet/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './createWallet';
diff --git a/js/packages/dapp-accounts/ExportAccount/exportAccount.js b/js/packages/dapp-accounts/ExportAccount/exportAccount.js
deleted file mode 100644
index 8b0974208..000000000
--- a/js/packages/dapp-accounts/ExportAccount/exportAccount.js
+++ /dev/null
@@ -1,179 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { observer } from 'mobx-react';
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-import { connect } from 'react-redux';
-import { bindActionCreators } from 'redux';
-
-import { newError } from '@parity/shared/redux/actions';
-import { personalAccountsInfo } from '@parity/shared/redux/providers/personalActions';
-import { AccountCard, Button, Portal, SelectionList } from '@parity/ui';
-import { CancelIcon, CheckIcon } from '@parity/ui/Icons';
-
-import ExportInput from './exportInput';
-import ExportStore from './exportStore';
-
-@observer
-class ExportAccount extends Component {
- static contextTypes = {
- api: PropTypes.object.isRequired
- };
-
- static propTypes = {
- accounts: PropTypes.object.isRequired,
- balances: PropTypes.object.isRequired,
- newError: PropTypes.func.isRequired,
- personalAccountsInfo: PropTypes.func.isRequired,
- onClose: PropTypes.func.isRequired
- };
-
- componentWillMount () {
- const { accounts, newError } = this.props;
-
- this.exportStore = new ExportStore(this.context.api, accounts, newError, null);
- }
-
- render () {
- const { canExport } = this.exportStore;
-
- return (
- }
- key='cancel'
- label={
-
- }
- onClick={ this.onClose }
- />,
- }
- key='execute'
- label={
-
- }
- onClick={ this.onExport }
- />
- ] }
- onClose={ this.onClose }
- open
- title={
-
- }
- >
- { this.renderList() }
-
- );
- }
-
- renderList () {
- const { accounts } = this.props;
-
- const { selectedAccounts } = this.exportStore;
-
- const accountList = Object.values(accounts)
- .filter((account) => account.uuid)
- .map((account) => {
- account.checked = !!(selectedAccounts[account.address]);
-
- return account;
- });
-
- return (
-
- );
- }
-
- renderAccount = (account) => {
- const { balances } = this.props;
- const balance = balances[account.address];
- const { changePassword, getPassword } = this.exportStore;
- const password = getPassword(account);
-
- return (
-
-
-
-
-
- );
- }
-
- onSelect = (account) => {
- this.exportStore.toggleSelectedAccount(account.address);
- }
-
- onClick = (address) => {
- this.exportStore.onClick(address);
- }
-
- onClose = () => {
- this.props.onClose();
- }
-
- onExport = () => {
- this.exportStore.onExport();
- }
-}
-
-function mapStateToProps (state) {
- const { balances } = state;
- const { accounts } = state.personal;
-
- return {
- accounts,
- balances
- };
-}
-
-function mapDispatchToProps (dispatch) {
- return bindActionCreators({
- newError,
- personalAccountsInfo
- }, dispatch);
-}
-
-export default connect(
- mapStateToProps,
- mapDispatchToProps
-)(ExportAccount);
diff --git a/js/packages/dapp-accounts/ExportAccount/exportAccount.spec.js b/js/packages/dapp-accounts/ExportAccount/exportAccount.spec.js
deleted file mode 100644
index 7f185cc07..000000000
--- a/js/packages/dapp-accounts/ExportAccount/exportAccount.spec.js
+++ /dev/null
@@ -1,76 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { shallow } from 'enzyme';
-import React from 'react';
-import sinon from 'sinon';
-
-import ExportAccount from './';
-
-const ADDRESS = '0x0123456789012345678901234567890123456789';
-
-let component;
-let NEWERROR;
-let PAI;
-let ONCLOSE;
-
-let reduxStore;
-
-function createReduxStore () {
- reduxStore = {
- dispatch: sinon.stub(),
- subscribe: sinon.stub(),
- getState: () => {
- return {
- balances: {
- balances: {
- [ADDRESS]: {}
- }
- },
- personal: {
- accounts: {
- [ADDRESS]: {
- address: ADDRESS
- }
- }
- }
- };
- }
- };
-
- return reduxStore;
-}
-
-function render () {
- component = shallow(
- ,
- {
- context: { api: {}, store: createReduxStore() }
- }
- );
-
- return component;
-}
-
-describe('CreateExportModal', () => {
- it('renders defaults', () => {
- expect(render()).to.be.ok;
- });
-});
diff --git a/js/packages/dapp-accounts/ExportAccount/exportInput/exportInput.js b/js/packages/dapp-accounts/ExportAccount/exportInput/exportInput.js
deleted file mode 100644
index f6f677fe7..000000000
--- a/js/packages/dapp-accounts/ExportAccount/exportInput/exportInput.js
+++ /dev/null
@@ -1,63 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-
-import { Input } from '@parity/ui/Form';
-
-export default class ExportInput extends Component {
- static propTypes = {
- account: PropTypes.object.isRequired,
- onClick: PropTypes.func.isRequired,
- onChange: PropTypes.func.isRequired,
- value: PropTypes.string
- };
-
- render () {
- const { value, onChange } = this.props;
-
- return (
-
- }
- hint={
-
- }
- value={ value }
- onClick={ this.onClick }
- onChange={ onChange }
- />
- );
- }
-
- onClick = (event) => {
- const { account, onClick } = this.props;
-
- event.stopPropagation();
-
- onClick && onClick(account.address);
- }
-}
diff --git a/js/packages/dapp-accounts/ExportAccount/exportInput/index.js b/js/packages/dapp-accounts/ExportAccount/exportInput/index.js
deleted file mode 100644
index fb685bf6b..000000000
--- a/js/packages/dapp-accounts/ExportAccount/exportInput/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './exportInput';
diff --git a/js/packages/dapp-accounts/ExportAccount/exportStore.js b/js/packages/dapp-accounts/ExportAccount/exportStore.js
deleted file mode 100644
index cba8d00a9..000000000
--- a/js/packages/dapp-accounts/ExportAccount/exportStore.js
+++ /dev/null
@@ -1,106 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { action, observable } from 'mobx';
-import FileSaver from 'file-saver';
-
-export default class ExportStore {
- @observable canExport = false;
- @observable selectedAccount = '';
- @observable selectedAccounts = {};
- @observable passwordInputs = {};
-
- constructor (api, accounts, newError, address) {
- this.accounts = accounts;
- this._api = api;
- this._newError = newError;
- if (address) {
- this.selectedAccounts[address] = true;
- this.selectedAccount = address;
- }
- }
-
- @action changePassword = (event, password) => {
- this.passwordInputs[this.selectedAccount] = password;
- }
-
- @action getPassword = (address) => {
- return this.passwordInputs[address];
- }
-
- @action onClick = (address) => {
- this.selectedAccount = address;
- }
-
- @action resetAccountValue = () => {
- this.passwordInputs[this.selectedAccount] = '';
- }
-
- @action setAccounts = (accounts) => {
- this.accounts = accounts;
- }
-
- @action setSelectedAccount = (addr) => {
- this.selectedAccounts[addr] = true;
- this.canExport = true;
- }
-
- @action toggleSelectedAccount = (addr) => {
- if (this.selectedAccounts[addr]) {
- delete this.selectedAccounts[addr];
- } else {
- this.selectedAccounts[addr] = true;
- }
- this.canExport = false;
- Object
- .keys(this.selectedAccounts)
- .forEach((address) => {
- if (this.selectedAccounts[address]) {
- this.canExport = true;
- }
- });
- }
-
- onExport = (event) => {
- const { parity } = this._api;
- const accounts = Object.keys(this.selectedAccounts);
-
- accounts.forEach((address) => {
- let password = this.passwordInputs[address];
-
- parity
- .exportAccount(address, password)
- .then((content) => {
- const text = JSON.stringify(content, null, 4);
- const blob = new Blob([ text ], { type: 'application/json' });
- const filename = this.accounts[address].uuid;
-
- FileSaver.saveAs(blob, `${filename}.json`);
-
- this.accountValue = '';
- if (event) { event(); }
- })
- .catch((err) => {
- const { name, meta } = this.accounts[address];
- const { passwordHint } = meta;
-
- this._newError({
- message: `[${err.code}] Account "${name}" - Incorrect password. (Password Hint: ${passwordHint})`
- });
- });
- });
- }
-}
diff --git a/js/packages/dapp-accounts/ExportAccount/exportStore.spec.js b/js/packages/dapp-accounts/ExportAccount/exportStore.spec.js
deleted file mode 100644
index 08dcbddb8..000000000
--- a/js/packages/dapp-accounts/ExportAccount/exportStore.spec.js
+++ /dev/null
@@ -1,133 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import sinon from 'sinon';
-
-import ExportStore from './exportStore';
-
-const ADDRESS = '0x00000123456789abcdef123456789abcdef123456789abcdef';
-const ADDRESS_2 = '0x123456789abcdef123456789abcdef123456789abcdef00000';
-const ACCOUNTS = { ADDRESS: {}, ADDRESS_2: {} };
-
-let api;
-let AccountStore;
-
-function createApi () {
- return {
- eth: {
- },
- parity: {
- exportAccount: sinon.stub().resolves({})
- }
- };
-}
-
-function createMultiAccountStore (loadGeth) {
- api = createApi();
- AccountStore = new ExportStore(api, ACCOUNTS, null, null);
-
- return AccountStore;
-}
-
-describe('modals/exportAccount/Store', () => {
- beforeEach(() => {
- createMultiAccountStore();
- });
-
- describe('constructor', () => {
- it('insert api', () => {
- expect(AccountStore._api).to.deep.equal(api);
- });
-
- it('insert accounts', () => {
- expect(AccountStore.accounts).to.deep.equal(ACCOUNTS);
- });
-
- it('newError created', () => {
- expect(AccountStore._newError).to.deep.equal(null);
- });
- });
-
- describe('@action', () => {
- describe('toggleSelectedAccount', () => {
- it('Updates the selected accounts', () => {
- // First set selectedAccounts
- AccountStore.selectedAccounts = {
- [ADDRESS]: true,
- [ADDRESS_2]: false
- };
- // Toggle
- AccountStore.toggleSelectedAccount(ADDRESS_2);
- // Prep eqality
- const eq = {
- [ADDRESS]: true,
- [ADDRESS_2]: true
- };
-
- // Check equality
- expect(JSON.stringify(AccountStore.selectedAccounts)).to.deep.equal(JSON.stringify(eq));
- });
- });
-
- describe('getPassword', () => {
- it('Grab from the selected accounts input', () => {
- // First set passwordInputs
- AccountStore.passwordInputs = {
- [ADDRESS]: 'abc'
- };
- // getPassword
- const pass = AccountStore.getPassword(ADDRESS);
-
- // Check equality
- expect(AccountStore.passwordInputs[ADDRESS]).to.deep.equal(pass);
- });
- });
-
- describe('setPassword & getPassword', () => {
- it('First save the input of the selected account, than get the input.', () => {
- // Set password
- AccountStore.selectedAccount = ADDRESS;
- // Set new pass
- AccountStore.changePassword(null, 'abc');
- // getPassword
- const pass = AccountStore.getPassword(ADDRESS);
-
- // Check equality
- expect(AccountStore.passwordInputs[ADDRESS]).to.deep.equal(pass);
- });
- });
-
- describe('changePassword', () => {
- it('Change the stored value with the new input.', () => {
- // First set selectedAccounts
- AccountStore.selectedAccounts = {
- [ADDRESS]: true,
- [ADDRESS_2]: false
- };
- // First set passwordInputs
- AccountStore.passwordInputs = {
- [ADDRESS]: 'abc'
- };
- // 'Click' on the address:
- AccountStore.onClick(ADDRESS);
- // Change password
- AccountStore.changePassword(null, '123');
- // Check equality
- expect(AccountStore.passwordInputs[ADDRESS]).to.deep.equal('123');
- });
- });
- });
-});
diff --git a/js/packages/dapp-accounts/ExportAccount/index.js b/js/packages/dapp-accounts/ExportAccount/index.js
deleted file mode 100644
index eb61a884b..000000000
--- a/js/packages/dapp-accounts/ExportAccount/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './exportAccount';
diff --git a/js/packages/dapp-accounts/List/index.js b/js/packages/dapp-accounts/List/index.js
deleted file mode 100644
index e729c76a0..000000000
--- a/js/packages/dapp-accounts/List/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './list';
diff --git a/js/packages/dapp-accounts/List/list.css b/js/packages/dapp-accounts/List/list.css
deleted file mode 100644
index 15d9cc597..000000000
--- a/js/packages/dapp-accounts/List/list.css
+++ /dev/null
@@ -1,46 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.list {
- display: flex;
- flex-wrap: wrap;
-
- .item {
- box-sizing: border-box;
- flex: 0 1 50%;
- padding-bottom: 0.25em;
- position: relative;
- width: 50%;
-
- &:nth-child(odd) {
- padding-right: 0.125em;
- }
-
- &:nth-child(even) {
- padding-left: 0.125em;
- }
- }
-}
-
-.empty {
- display: block;
- width: 100%;
-
- div {
- color: #aaa;
- }
-}
diff --git a/js/packages/dapp-accounts/List/list.js b/js/packages/dapp-accounts/List/list.js
deleted file mode 100644
index 09c4b826c..000000000
--- a/js/packages/dapp-accounts/List/list.js
+++ /dev/null
@@ -1,278 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { pick } from 'lodash';
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { connect } from 'react-redux';
-import { bindActionCreators } from 'redux';
-
-import { ETH_TOKEN } from '@parity/shared/util/tokens';
-import { fetchCertifiers, fetchCertifications } from '@parity/shared/redux/providers/certifications/actions';
-import { Container, SectionList } from '@parity/ui';
-
-import Summary from '../Summary';
-import styles from './list.css';
-
-class List extends Component {
- static propTypes = {
- balances: PropTypes.object.isRequired,
- certifications: PropTypes.object.isRequired,
- accounts: PropTypes.object,
- disabled: PropTypes.object,
- empty: PropTypes.bool,
- link: PropTypes.string,
- order: PropTypes.string,
- orderFallback: PropTypes.string,
- search: PropTypes.array,
-
- fetchCertifiers: PropTypes.func.isRequired,
- fetchCertifications: PropTypes.func.isRequired,
- handleAddSearchToken: PropTypes.func
- };
-
- componentWillMount () {
- const { accounts, fetchCertifiers, fetchCertifications } = this.props;
-
- fetchCertifiers();
- for (let address in accounts) {
- fetchCertifications(address);
- }
- }
-
- render () {
- const { accounts, disabled, empty } = this.props;
-
- if (empty) {
- return (
-
-
- There are currently no accounts or addresses to display.
-
-
- );
- }
-
- const addresses = this
- .getAddresses()
- .map((address) => {
- const account = accounts[address] || {};
- const isDisabled = disabled ? disabled[address] : false;
- const owners = account.owners || null;
-
- return {
- account,
- isDisabled,
- owners
- };
- });
-
- return (
-
- );
- }
-
- renderSummary = (item) => {
- const { account, isDisabled, owners } = item;
- const { handleAddSearchToken, link } = this.props;
-
- return (
-
- );
- }
-
- getAddresses () {
- const filteredAddresses = this.getFilteredAddresses();
-
- return this.sortAddresses(filteredAddresses);
- }
-
- sortAddresses (addresses) {
- const { order, orderFallback } = this.props;
-
- if (!order) {
- return addresses;
- }
-
- const { accounts } = this.props;
-
- return addresses.sort((addressA, addressB) => {
- const accountA = accounts[addressA];
- const accountB = accounts[addressB];
-
- const sort = this.compareAccounts(accountA, accountB, order);
-
- if (sort === 0 && orderFallback) {
- return this.compareAccounts(accountA, accountB, orderFallback);
- }
-
- return sort;
- });
- }
-
- compareAccounts (accountA, accountB, key, _reverse = null) {
- if (key && key.split(':')[1] === '-1') {
- return this.compareAccounts(accountA, accountB, key.split(':')[0], true);
- }
-
- if (key === 'timestamp' && _reverse === null) {
- return this.compareAccounts(accountA, accountB, key, true);
- }
-
- if (key === 'name') {
- return accountA.name.localeCompare(accountB.name);
- }
-
- if (key === 'eth') {
- const { balances } = this.props;
-
- const balanceA = balances[accountA.address];
- const balanceB = balances[accountB.address];
-
- if (!balanceA && !balanceB) {
- return 0;
- } else if (balanceA && !balanceB) {
- return -1;
- } else if (!balanceA && balanceB) {
- return 1;
- }
-
- const ethA = balanceA[ETH_TOKEN.id];
- const ethB = balanceB[ETH_TOKEN.id];
-
- if (!ethA && !ethB) {
- return 0;
- } else if (ethA && !ethB) {
- return -1;
- } else if (!ethA && ethB) {
- return 1;
- }
-
- return -1 * ethA.comparedTo(ethB);
- }
-
- if (key === 'tags') {
- const tagsA = [].concat(accountA.meta.tags)
- .filter(t => t)
- .sort()
- .join('');
-
- const tagsB = [].concat(accountB.meta.tags)
- .filter(t => t)
- .sort()
- .join('');
-
- if (!tagsA && !tagsB) {
- return 0;
- } else if (tagsA && !tagsB) {
- return -1;
- } else if (!tagsA && tagsB) {
- return 1;
- }
-
- return tagsA.localeCompare(tagsB);
- }
-
- const reverse = _reverse
- ? -1
- : 1;
-
- const metaA = accountA.meta[key];
- const metaB = accountB.meta[key];
-
- if (!metaA && !metaB) {
- return 0;
- }
-
- if (metaA && !metaB) {
- return -1;
- }
-
- if (metaA < metaB) {
- return -1 * reverse;
- }
-
- if (!metaA && metaB) {
- return 1;
- }
-
- if (metaA > metaB) {
- return 1 * reverse;
- }
-
- return 0;
- }
-
- getFilteredAddresses () {
- const { accounts, search } = this.props;
- const searchValues = (search || []).map(v => v.toLowerCase());
-
- if (searchValues.length === 0) {
- return Object.keys(accounts);
- }
-
- return Object.keys(accounts)
- .filter((address) => {
- const account = accounts[address];
-
- const tags = account.meta.tags || [];
- const name = account.name || '';
-
- const values = tags
- .concat(name)
- .map(v => v.toLowerCase());
-
- return searchValues
- .map(searchValue => {
- return values
- .some(value => value.indexOf(searchValue) >= 0);
- })
- // `current && truth, true` => use tokens as AND
- // `current || truth, false` => use tokens as OR
- .reduce((current, truth) => current && truth, true);
- });
- }
-}
-
-function mapStateToProps (state, props) {
- const addresses = Object.keys(props.accounts);
- const balances = pick(state.balances, addresses);
- const { certifications } = state;
-
- return { balances, certifications };
-}
-
-function mapDispatchToProps (dispatch) {
- return bindActionCreators({
- fetchCertifiers,
- fetchCertifications
- }, dispatch);
-}
-
-export default connect(
- mapStateToProps,
- mapDispatchToProps
-)(List);
diff --git a/js/packages/dapp-accounts/Summary/index.js b/js/packages/dapp-accounts/Summary/index.js
deleted file mode 100644
index e36c50678..000000000
--- a/js/packages/dapp-accounts/Summary/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './summary';
diff --git a/js/packages/dapp-accounts/Summary/summary.js b/js/packages/dapp-accounts/Summary/summary.js
deleted file mode 100644
index 59388499f..000000000
--- a/js/packages/dapp-accounts/Summary/summary.js
+++ /dev/null
@@ -1,295 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import BigNumber from 'bignumber.js';
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { connect } from 'react-redux';
-import { Link } from 'react-router';
-import { isEqual } from 'lodash';
-import ReactTooltip from 'react-tooltip';
-import { FormattedMessage } from 'react-intl';
-
-import { arrayOrObjectProptype, nullableProptype } from '@parity/shared/util/proptypes';
-import { Balance, Certifications, Container, ContainerTitle, CopyToClipboard, IdentityIcon, IdentityName, Tags, VaultTag } from '@parity/ui';
-
-import styles from '../accounts.css';
-
-class Summary extends Component {
- static contextTypes = {
- api: React.PropTypes.object
- };
-
- static propTypes = {
- account: PropTypes.object.isRequired,
- accountsInfo: PropTypes.object.isRequired,
- disabled: PropTypes.bool,
- link: PropTypes.string,
- name: PropTypes.string,
- noLink: PropTypes.bool,
- showCertifications: PropTypes.bool,
- handleAddSearchToken: PropTypes.func,
- owners: nullableProptype(arrayOrObjectProptype())
- };
-
- static defaultProps = {
- noLink: false,
- showCertifications: false
- };
-
- shouldComponentUpdate (nextProps) {
- const prev = {
- link: this.props.link,
- disabled: this.props.disabled,
- name: this.props.name,
- noLink: this.props.noLink,
- meta: this.props.account.meta,
- address: this.props.account.address
- };
-
- const next = {
- link: nextProps.link,
- disabled: nextProps.disabled,
- name: nextProps.name,
- noLink: nextProps.noLink,
- meta: nextProps.account.meta,
- address: nextProps.account.address
- };
-
- if (!isEqual(next, prev)) {
- return true;
- }
-
- const prevOwners = this.props.owners;
- const nextOwners = nextProps.owners;
-
- if (!isEqual(prevOwners, nextOwners)) {
- return true;
- }
-
- return false;
- }
-
- render () {
- const { account, disabled, handleAddSearchToken, noLink } = this.props;
- const { tags } = account.meta;
-
- if (!account) {
- return null;
- }
-
- const { address } = account;
-
- return (
-
- { this.renderBalance(false) }
- { this.renderDescription(account.meta) }
- { this.renderOwners() }
- { this.renderVault(account.meta) }
-
- }
- link={ this.getLink() }
- >
-
-
- );
- }
-
- renderAccounts () {
- const { accounts } = this.props;
- const _accounts = pickBy(accounts, (account) => account.uuid);
- const _hasAccounts = Object.keys(_accounts).length > 0;
-
- if (!this.state.show) {
- return this.renderLoading(_accounts);
- }
-
- const { searchValues, sortOrder } = this.state;
-
- return (
-
- );
- }
-
- renderWallets () {
- const { accounts } = this.props;
- const wallets = pickBy(accounts, (account) => account.wallet);
- const hasWallets = Object.keys(wallets).length > 0;
-
- if (!hasWallets) {
- return null;
- }
-
- if (!this.state.show) {
- return this.renderLoading(wallets);
- }
-
- const { searchValues, sortOrder } = this.state;
-
- return (
-
- );
- }
-
- renderExternalAccounts () {
- const { accounts } = this.props;
- const { wallets } = this.hwstore;
- const hardware = pickBy(accounts, (account) => account.hardware);
- const external = pickBy(accounts, (account) => account.external);
- const all = Object.assign({}, hardware, external);
-
- if (Object.keys(all).length === 0) {
- return null;
- }
-
- if (!this.state.show) {
- return this.renderLoading(hardware);
- }
-
- const { searchValues, sortOrder } = this.state;
- const disabled = Object
- .keys(hardware)
- .filter((address) => !wallets[address])
- .reduce((result, address) => {
- result[address] = true;
- return result;
- }, {});
-
- return (
-
- );
- }
-
- renderSearchButton () {
- const onChange = (searchTokens, searchValues) => {
- this.setState({ searchTokens, searchValues });
- };
-
- return (
-
- );
- }
-
- renderSortButton () {
- const onChange = (sortOrder) => {
- this.setState({ sortOrder });
- };
-
- return (
-
- );
- }
-
- renderActionbar () {
- const buttons = [
- this.renderVaultsButton(),
- }
- label={
-
- }
- onClick={ this.onNewAccountClick }
- />,
- this.renderNewWalletButton(),
- }
- label={
-
- }
- onClick={ this.onRestoreAccountClick }
- />,
- }
- label={
-
- }
- onClick={ this.onNewExportClick }
- />,
- this.renderSearchButton(),
- this.renderSortButton()
- ];
-
- return (
-
- }
- buttons={ buttons }
- />
- );
- }
-
- renderNewDialog () {
- const { accounts } = this.props;
- const { newDialog } = this.state;
-
- if (!newDialog) {
- return null;
- }
-
- return (
-
- );
- }
-
- renderRestoreDialog () {
- const { accounts } = this.props;
- const { restoreDialog } = this.state;
-
- if (!restoreDialog) {
- return null;
- }
-
- return (
-
- );
- }
-
- renderVaultsButton () {
- if (this.props.availability !== 'personal') {
- return null;
- }
-
- return (
-
- }
- label={
-
- }
- onClick={ this.onVaultsClick }
- />
-
- );
- }
-
- renderNewWalletButton () {
- if (this.props.availability !== 'personal') {
- return null;
- }
-
- return (
- }
- label={
-
- }
- onClick={ this.onNewWalletClick }
- />
- );
- }
-
- renderNewWalletDialog () {
- const { accounts } = this.props;
- const { newWalletDialog } = this.state;
-
- if (!newWalletDialog) {
- return null;
- }
-
- return (
-
- );
- }
-
- renderNewExportDialog () {
- const { newExportDialog } = this.state;
-
- if (!newExportDialog) {
- return null;
- }
-
- return (
-
- );
- }
-
- onAddSearchToken = (token) => {
- const { searchTokens } = this.state;
- const newSearchTokens = uniq([].concat(searchTokens, token));
-
- this.setState({ searchTokens: newSearchTokens });
- }
-
- onNewAccountClick = () => {
- this.setState({
- newDialog: true
- });
- }
-
- onRestoreAccountClick = () => {
- this.setState({
- restoreDialog: true
- });
- }
-
- onNewWalletClick = () => {
- this.setState({
- newWalletDialog: true
- });
- }
-
- onNewExportClick = () => {
- this.setState({
- newExportDialog: true
- });
- }
-
- onNewAccountClose = () => {
- this.setState({
- newDialog: false
- });
- }
-
- onRestoreAccountClose = () => {
- this.setState({
- restoreDialog: false
- });
- }
-
- onNewWalletClose = () => {
- this.setState({
- newWalletDialog: false
- });
- }
-
- onNewExportClose = () => {
- this.setState({
- newExportDialog: false
- });
- }
-
- onHardwareChange = () => {
- const { accountsInfo } = this.props;
- const { wallets } = this.hwstore;
-
- Object
- .keys(wallets)
- .filter((address) => {
- const account = accountsInfo[address];
-
- return !account || !account.meta || !account.meta.hardware;
- })
- .forEach((address) => this.hwstore.createAccountInfo(wallets[address], accountsInfo[address]));
-
- this.setVisibleAccounts();
- }
-}
-
-function mapStateToProps (state) {
- const { accounts, accountsInfo, hasAccounts } = state.personal;
- const { availability = 'unknown' } = state.nodeStatus.nodeKind || {};
- const { health } = state.nodeStatus;
-
- return {
- accounts,
- accountsInfo,
- availability,
- hasAccounts,
- health
- };
-}
-
-function mapDispatchToProps (dispatch) {
- return bindActionCreators({
- setVisibleAccounts
- }, dispatch);
-}
-
-export default connect(
- mapStateToProps,
- mapDispatchToProps
-)(Accounts);
diff --git a/js/packages/dapp-accounts/accounts.spec.js b/js/packages/dapp-accounts/accounts.spec.js
deleted file mode 100644
index d0f202491..000000000
--- a/js/packages/dapp-accounts/accounts.spec.js
+++ /dev/null
@@ -1,127 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { shallow } from 'enzyme';
-import React from 'react';
-import sinon from 'sinon';
-
-import Accounts from './accounts';
-
-let api;
-let component;
-let hwstore;
-let instance;
-let redux;
-
-function createApi () {
- api = {};
-
- return api;
-}
-
-function createHwStore (walletAddress = '0x456') {
- hwstore = {
- wallets: {
- [walletAddress]: {
- address: walletAddress
- }
- },
- createAccountInfo: sinon.stub()
- };
-
- return hwstore;
-}
-
-function createRedux () {
- redux = {
- dispatch: sinon.stub(),
- subscribe: sinon.stub(),
- getState: () => {
- return {
- personal: {
- accounts: {},
- accountsInfo: {
- '0x123': { meta: '1' },
- '0x999': { meta: { hardware: {} } }
- }
- },
- balances: {
- balances: {}
- },
- nodeStatus: {
- nodeKind: {
- 'availability': 'personal'
- }
- }
- };
- }
- };
-
- return redux;
-}
-
-function render (props = {}) {
- component = shallow(
- ,
- {
- context: {
- store: createRedux()
- }
- }
- ).find('Accounts').shallow({
- context: {
- api: createApi()
- }
- });
- instance = component.instance();
-
- return component;
-}
-
-describe('views/Accounts', () => {
- beforeEach(() => {
- render();
- });
-
- it('renders defaults', () => {
- expect(component).to.be.ok;
- });
-
- describe('instance event methods', () => {
- describe('onHardwareChange', () => {
- it('detects completely new entries', () => {
- instance.hwstore = createHwStore();
- instance.onHardwareChange();
-
- expect(hwstore.createAccountInfo).to.have.been.calledWith({ address: '0x456' });
- });
-
- it('detects addressbook entries', () => {
- instance.hwstore = createHwStore('0x123');
- instance.onHardwareChange();
-
- expect(hwstore.createAccountInfo).to.have.been.calledWith({ address: '0x123' }, { meta: '1' });
- });
-
- it('ignores existing hardware entries', () => {
- instance.hwstore = createHwStore('0x999');
- instance.onHardwareChange();
-
- expect(hwstore.createAccountInfo).not.to.have.been.called;
- });
- });
- });
-});
diff --git a/js/packages/dapp-accounts/api.js b/js/packages/dapp-accounts/api.js
deleted file mode 100644
index b2e52cca0..000000000
--- a/js/packages/dapp-accounts/api.js
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import Api from '@parity/api';
-
-const ethereumProvider = window.ethereum || window.parent.ethereum;
-
-if (!ethereumProvider) {
- throw new Error('Unable to locate EthereumProvider, object not attached');
-}
-
-export default new Api(ethereumProvider);
diff --git a/js/packages/dapp-accounts/index.js b/js/packages/dapp-accounts/index.js
deleted file mode 100644
index 50966a1e6..000000000
--- a/js/packages/dapp-accounts/index.js
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import ReactDOM from 'react-dom';
-import React from 'react';
-import { Route, Router, hashHistory } from 'react-router';
-
-import injectTapEventPlugin from 'react-tap-event-plugin';
-injectTapEventPlugin();
-
-import ContractInstances from '@parity/shared/contracts';
-import { initStore } from '@parity/shared/redux';
-import ContextProvider from '@parity/ui/ContextProvider';
-
-import api from './api';
-
-import Accounts from './accounts';
-
-ContractInstances.get(api);
-
-const store = initStore(api, hashHistory);
-
-ReactDOM.render(
-
-
-
-
- ,
- document.querySelector('#container')
-);
diff --git a/js/packages/dapp-accounts/package.json b/js/packages/dapp-accounts/package.json
deleted file mode 100644
index fe2ffb29b..000000000
--- a/js/packages/dapp-accounts/package.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "name": "@parity/dapp-accounts",
- "description": "Parity default accounts list view",
- "version": "1.99.99",
- "main": "index.js",
- "author": "Parity Team ",
- "maintainers": [],
- "contributors": [],
- "license": "GPL-3.0",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/paritytech/dapp-accounts.git"
- },
- "keywords": [],
- "scripts": {},
- "devDependencies": {},
- "dependencies": {},
- "peerDependencies": {}
-}
diff --git a/js/packages/dapp-address/Delete/delete.js b/js/packages/dapp-address/Delete/delete.js
deleted file mode 100644
index 4aa16772c..000000000
--- a/js/packages/dapp-address/Delete/delete.js
+++ /dev/null
@@ -1,136 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-import { connect } from 'react-redux';
-import { bindActionCreators } from 'redux';
-
-import { newError } from '@parity/shared/redux/actions';
-import { ConfirmDialog, IdentityIcon, IdentityName } from '@parity/ui';
-
-import styles from '../address.css';
-
-class Delete extends Component {
- static contextTypes = {
- api: PropTypes.object.isRequired,
- router: PropTypes.object
- };
-
- static propTypes = {
- route: PropTypes.string.isRequired,
-
- address: PropTypes.string,
- account: PropTypes.object,
- confirmMessage: PropTypes.node,
- visible: PropTypes.bool,
- onClose: PropTypes.func,
- newError: PropTypes.func
- };
-
- state = {
- isBusy: false
- };
-
- render () {
- const { account, confirmMessage, visible } = this.props;
- const { isBusy } = this.state;
-
- if (!visible) {
- return null;
- }
-
- return (
-
- }
- visible
- onDeny={ this.closeDeleteDialog }
- onConfirm={ this.onDeleteConfirmed }
- >
-
- {
- confirmMessage || (
-
- )
- }
-
-
-
-
-
-
-
-
- { account.address }
-
-
-
-
- { account.meta.description }
-
-
- );
- }
-
- onDeleteConfirmed = () => {
- const { api, router } = this.context;
- const { account, route, newError } = this.props;
-
- this.setState({ isBusy: true });
-
- api.parity
- .removeAddress(account.address)
- .then(() => {
- router.push(route);
- this.closeDeleteDialog();
- })
- .catch((error) => {
- console.error('onDeleteConfirmed', error);
- newError(new Error(`Deletion failed: ${error.message}`));
- this.closeDeleteDialog();
- });
- }
-
- closeDeleteDialog = () => {
- this.props.onClose();
- }
-}
-
-function mapDispatchToProps (dispatch) {
- return bindActionCreators({ newError }, dispatch);
-}
-
-export default connect(
- null,
- mapDispatchToProps
-)(Delete);
diff --git a/js/packages/dapp-address/Delete/index.js b/js/packages/dapp-address/Delete/index.js
deleted file mode 100644
index 6a0b8d5ee..000000000
--- a/js/packages/dapp-address/Delete/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './delete';
diff --git a/js/packages/dapp-address/address.css b/js/packages/dapp-address/address.css
deleted file mode 100644
index 908c1822f..000000000
--- a/js/packages/dapp-address/address.css
+++ /dev/null
@@ -1,50 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.delete {
- .hero {
- padding-bottom: 1em;
- }
-
- .info {
- display: inline-block;
- }
-
- .icon {
- display: inline-block;
- }
-
- .nameinfo {
- display: inline-block;
- text-align: left;
- }
-
- .header {
- text-transform: uppercase;
- font-size: 1.25em;
- padding-bottom: 0.25em;
- }
-
- .address {
- }
-
- .description {
- padding-top: 1em;
- font-size: 0.75em;
- color: #aaa;
- }
-}
diff --git a/js/packages/dapp-address/address.js b/js/packages/dapp-address/address.js
deleted file mode 100644
index d6b7540c0..000000000
--- a/js/packages/dapp-address/address.js
+++ /dev/null
@@ -1,258 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-import { connect } from 'react-redux';
-import { bindActionCreators } from 'redux';
-
-import { setVisibleAccounts } from '@parity/shared/redux/providers/personalActions';
-import { Actionbar, Button, Page } from '@parity/ui';
-import { AddIcon, DeleteIcon, EditIcon } from '@parity/ui/Icons';
-
-import EditMeta from '@parity/dapp-account/EditMeta';
-import Header from '@parity/dapp-account/Header';
-import Transactions from '@parity/dapp-account/Transactions';
-import AddAddress from '@parity/dapp-addresses/AddAddress';
-
-import Delete from './Delete';
-
-class Address extends Component {
- static contextTypes = {
- api: PropTypes.object.isRequired,
- router: PropTypes.object.isRequired
- };
-
- static propTypes = {
- setVisibleAccounts: PropTypes.func.isRequired,
-
- contacts: PropTypes.object,
- params: PropTypes.object
- };
-
- state = {
- showDeleteDialog: false,
- showEditDialog: false,
- showAdd: false
- };
-
- componentDidMount () {
- this.setVisibleAccounts();
- }
-
- componentWillReceiveProps (nextProps) {
- const prevAddress = this.props.params.address;
- const nextAddress = nextProps.params.address;
-
- if (prevAddress !== nextAddress) {
- this.setVisibleAccounts(nextProps);
- }
- }
-
- componentWillUnmount () {
- this.props.setVisibleAccounts([]);
- }
-
- setVisibleAccounts (props = this.props) {
- const { params, setVisibleAccounts } = props;
- const addresses = [ params.address ];
-
- setVisibleAccounts(addresses);
- }
-
- render () {
- const { contacts } = this.props;
- const { address } = this.props.params;
-
- if (Object.keys(contacts).length === 0) {
- return null;
- }
-
- const contact = (contacts || {})[address];
-
- return (
-
- );
- }
-
- renderAddAddress (contact, address) {
- if (contact) {
- return null;
- }
-
- const { contacts } = this.props;
- const { showAdd } = this.state;
-
- if (!showAdd) {
- return null;
- }
-
- return (
-
- );
- }
-
- renderDelete (contact) {
- if (!contact) {
- return null;
- }
-
- const { showDeleteDialog } = this.state;
-
- return (
-
- );
- }
-
- renderActionbar (contact) {
- const buttons = [
- }
- label={
-
- }
- onClick={ this.onEditClick }
- />,
- }
- label={
-
- }
- onClick={ this.showDeleteDialog }
- />
- ];
-
- const addToBook = (
- }
- label={
-
- }
- onClick={ this.onOpenAdd }
- />
- );
-
- return (
-
- }
- buttons={
- !contact
- ? [ addToBook ]
- : buttons
- }
- />
- );
- }
-
- renderEditDialog (contact) {
- const { showEditDialog } = this.state;
-
- if (!contact || !showEditDialog) {
- return null;
- }
-
- return (
-
- );
- }
-
- onEditClick = () => {
- this.setState({
- showEditDialog: !this.state.showEditDialog
- });
- }
-
- closeDeleteDialog = () => {
- this.setState({ showDeleteDialog: false });
- }
-
- showDeleteDialog = () => {
- this.setState({ showDeleteDialog: true });
- }
-
- onOpenAdd = () => {
- this.setState({
- showAdd: true
- });
- }
-
- onCloseAdd = () => {
- this.setState({ showAdd: false });
- }
-}
-
-function mapStateToProps (state) {
- const { contacts } = state.personal;
-
- return {
- contacts
- };
-}
-
-function mapDispatchToProps (dispatch) {
- return bindActionCreators({
- setVisibleAccounts
- }, dispatch);
-}
-
-export default connect(
- mapStateToProps,
- mapDispatchToProps
-)(Address);
diff --git a/js/packages/dapp-address/api.js b/js/packages/dapp-address/api.js
deleted file mode 100644
index b2e52cca0..000000000
--- a/js/packages/dapp-address/api.js
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import Api from '@parity/api';
-
-const ethereumProvider = window.ethereum || window.parent.ethereum;
-
-if (!ethereumProvider) {
- throw new Error('Unable to locate EthereumProvider, object not attached');
-}
-
-export default new Api(ethereumProvider);
diff --git a/js/packages/dapp-address/index.js b/js/packages/dapp-address/index.js
deleted file mode 100644
index 9c4f80074..000000000
--- a/js/packages/dapp-address/index.js
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import ReactDOM from 'react-dom';
-import React from 'react';
-import { Route, Router, hashHistory } from 'react-router';
-
-import injectTapEventPlugin from 'react-tap-event-plugin';
-injectTapEventPlugin();
-
-import ContractInstances from '@parity/shared/contracts';
-import { initStore } from '@parity/shared/redux';
-import ContextProvider from '@parity/ui/ContextProvider';
-
-import api from './api';
-import Address from './address';
-
-ContractInstances.get(api);
-
-const store = initStore(api, hashHistory);
-
-ReactDOM.render(
-
-
-
-
- ,
- document.querySelector('#container')
-);
diff --git a/js/packages/dapp-address/package.json b/js/packages/dapp-address/package.json
deleted file mode 100644
index 1a46f5070..000000000
--- a/js/packages/dapp-address/package.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "name": "@parity/dapp-address",
- "description": "Parity default address view",
- "version": "1.99.99",
- "main": "index.js",
- "author": "Parity Team ",
- "maintainers": [],
- "contributors": [],
- "license": "GPL-3.0",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/paritytech/dapp-address.git"
- },
- "keywords": [],
- "scripts": {},
- "devDependencies": {},
- "dependencies": {},
- "peerDependencies": {}
-}
diff --git a/js/packages/dapp-addresses/AddAddress/addAddress.js b/js/packages/dapp-addresses/AddAddress/addAddress.js
deleted file mode 100644
index 894fe504b..000000000
--- a/js/packages/dapp-addresses/AddAddress/addAddress.js
+++ /dev/null
@@ -1,188 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { observer } from 'mobx-react';
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-
-import { Button, Form, Input, InputAddress, ModalBox, Portal } from '@parity/ui';
-import { AddIcon, AddressIcon, CancelIcon } from '@parity/ui/Icons';
-
-import Store from './store';
-
-@observer
-export default class AddAddress extends Component {
- static contextTypes = {
- api: PropTypes.object.isRequired
- }
-
- static propTypes = {
- address: PropTypes.string,
- contacts: PropTypes.object.isRequired,
- onClose: PropTypes.func.isRequired
- };
-
- store = new Store(this.context.api, this.props.contacts);
-
- componentWillMount () {
- if (this.props.address) {
- this.onEditAddress(null, this.props.address);
- }
- }
-
- render () {
- return (
-
- }
- visible
- >
- { this.renderFields() }
-
- );
- }
-
- renderDialogActions () {
- const { hasError } = this.store;
-
- return [
- }
- key='cancel'
- label={
-
- }
- onClick={ this.onClose }
- />,
- }
- key='save'
- label={
-
- }
- onClick={ this.onAdd }
- />
- ];
- }
-
- renderFields () {
- const { address, addressError, description, name, nameError } = this.store;
-
- return (
- }
- summary={
-
- }
- >
-
-
- );
- }
-
- onEditAddress = (event, address) => {
- this.store.setAddress(address);
- }
-
- onEditDescription = (event, description) => {
- this.store.setDescription(description);
- }
-
- onEditName = (event, name) => {
- this.store.setName(name);
- }
-
- onAdd = () => {
- this.store.add();
- this.onClose();
- }
-
- onClose = () => {
- this.props.onClose();
- }
-}
diff --git a/js/packages/dapp-addresses/AddAddress/addAddress.spec.js b/js/packages/dapp-addresses/AddAddress/addAddress.spec.js
deleted file mode 100644
index 136377651..000000000
--- a/js/packages/dapp-addresses/AddAddress/addAddress.spec.js
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { shallow } from 'enzyme';
-import React from 'react';
-
-import AddAddress from './';
-
-describe('modals/AddAddress', () => {
- describe('rendering', () => {
- it('renders defaults', () => {
- expect(
- shallow(
-
- )
- ).to.be.ok;
- });
- });
-});
diff --git a/js/packages/dapp-addresses/AddAddress/index.js b/js/packages/dapp-addresses/AddAddress/index.js
deleted file mode 100644
index eb2fb9081..000000000
--- a/js/packages/dapp-addresses/AddAddress/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './addAddress';
diff --git a/js/packages/dapp-addresses/AddAddress/store.js b/js/packages/dapp-addresses/AddAddress/store.js
deleted file mode 100644
index b7397b3d6..000000000
--- a/js/packages/dapp-addresses/AddAddress/store.js
+++ /dev/null
@@ -1,87 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { action, computed, transaction, observable } from 'mobx';
-
-import { ERRORS, validateAddress, validateName } from '@parity/shared/util/validation';
-
-export default class Store {
- @observable address = '';
- @observable addressError = ERRORS.invalidAddress;
- @observable createError = null;
- @observable description = '';
- @observable name = '';
- @observable nameError = ERRORS.invalidName;
-
- constructor (api, contacts) {
- this._api = api;
- this._contacts = contacts;
- }
-
- @computed get hasError () {
- return !!(this.addressError || this.nameError);
- }
-
- @action setAddress = (_address) => {
- let { address, addressError } = validateAddress(_address);
-
- if (!addressError) {
- const contact = this._contacts[address];
-
- if (contact) {
- addressError = ERRORS.duplicateAddress;
- }
- }
-
- transaction(() => {
- this.address = address;
- this.addressError = addressError;
- });
- }
-
- @action setCreateError = (error) => {
- this.createError = error;
- }
-
- @action setDescription = (description) => {
- this.description = description;
- }
-
- @action setName = (_name) => {
- const { name, nameError } = validateName(_name);
-
- transaction(() => {
- this.name = name;
- this.nameError = nameError;
- });
- }
-
- add () {
- return Promise
- .all([
- this._api.parity.setAccountName(this.address, this.name),
- this._api.parity.setAccountMeta(this.address, {
- description: this.description,
- timestamp: Date.now(),
- deleted: false
- })
- ])
- .catch((error) => {
- console.warn('Store:add', error);
- this.setCreateError(error);
- });
- }
-}
diff --git a/js/packages/dapp-addresses/AddAddress/store.spec.js b/js/packages/dapp-addresses/AddAddress/store.spec.js
deleted file mode 100644
index 47cab0df8..000000000
--- a/js/packages/dapp-addresses/AddAddress/store.spec.js
+++ /dev/null
@@ -1,128 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import sinon from 'sinon';
-
-import Store from './store';
-
-import { TEST_ADDR_A, TEST_ADDR_B, TEST_CONTACTS } from './store.test.js';
-
-describe('modals/AddAddress/store', () => {
- let store;
-
- describe('@action', () => {
- beforeEach(() => {
- store = new Store(null, TEST_CONTACTS);
- });
-
- describe('setAddress', () => {
- it('successfully sets non-existent addresses', () => {
- store.setAddress(TEST_ADDR_B);
-
- expect(store.addressError).to.be.null;
- expect(store.address).to.equal(TEST_ADDR_B);
- });
-
- it('fails on invalid addresses', () => {
- store.setAddress('0xinvalid');
-
- expect(store.addressError).not.to.be.null;
- });
-
- it('fails when an address is already added', () => {
- store.setAddress(TEST_ADDR_A);
-
- expect(store.addressError).not.to.be.null;
- });
- });
-
- describe('setName', () => {
- it('sucessfully sets valid names', () => {
- const name = 'Test Name';
-
- store.setName(name);
-
- expect(store.nameError).to.be.null;
- expect(store.name).to.equal(name);
- });
-
- it('fails when name is invalid', () => {
- store.setName(null);
-
- expect(store.nameError).not.to.be.null;
- });
- });
- });
-
- describe('@computed', () => {
- beforeEach(() => {
- store = new Store(null, TEST_CONTACTS);
- });
-
- describe('hasError', () => {
- beforeEach(() => {
- store.setAddress(TEST_ADDR_B);
- store.setName('Test Name');
- });
-
- it('returns false proper inputs', () => {
- expect(store.hasError).to.be.false;
- });
-
- it('returns true with addressError', () => {
- store.setAddress(TEST_ADDR_A);
-
- expect(store.addressError).not.to.be.null;
- expect(store.hasError).to.be.true;
- });
-
- it('returns true with nameError', () => {
- store.setName(null);
-
- expect(store.nameError).not.to.be.null;
- expect(store.hasError).to.be.true;
- });
- });
- });
-
- describe('methods', () => {
- let api;
-
- beforeEach(() => {
- api = {
- parity: {
- setAccountMeta: sinon.stub().resolves(true),
- setAccountName: sinon.stub().resolves(true)
- }
- };
- store = new Store(api, {});
- });
-
- describe('add', () => {
- it('calls setAccountMeta', () => {
- store.add();
-
- expect(api.parity.setAccountMeta).to.have.been.called;
- });
-
- it('calls setAccountName', () => {
- store.add();
-
- expect(api.parity.setAccountName).to.have.been.called;
- });
- });
- });
-});
diff --git a/js/packages/dapp-addresses/AddAddress/store.test.js b/js/packages/dapp-addresses/AddAddress/store.test.js
deleted file mode 100644
index b0f4c21d4..000000000
--- a/js/packages/dapp-addresses/AddAddress/store.test.js
+++ /dev/null
@@ -1,28 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-const TEST_ADDR_A = '0x63Cf90D3f0410092FC0fca41846f596223979195';
-const TEST_ADDR_B = '0x00A40dEfa9933e82244bE542Fa7F8748eCCdd457';
-
-const TEST_CONTACTS = {
- [TEST_ADDR_A]: { name: 'test', meta: {} }
-};
-
-export {
- TEST_ADDR_A,
- TEST_ADDR_B,
- TEST_CONTACTS
-};
diff --git a/js/packages/dapp-addresses/addresses.css b/js/packages/dapp-addresses/addresses.css
deleted file mode 100644
index e83342a1e..000000000
--- a/js/packages/dapp-addresses/addresses.css
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.list {
- display: flex;
- flex-wrap: wrap;
-}
-
-.address {
- flex: 0 1 50%;
- width: 50%;
- position: relative;
-
- &:nth-child(odd)>div {
- padding-right: 0.5em !important;
- }
-
- &:nth-child(even)>div {
- padding-left: 0.5em !important;
- }
-}
-
-.empty {
- width: 100%;
- display: block;
-
- div {
- color: #aaa;
- }
-}
diff --git a/js/packages/dapp-addresses/addresses.js b/js/packages/dapp-addresses/addresses.js
deleted file mode 100644
index 24cfdd7d7..000000000
--- a/js/packages/dapp-addresses/addresses.js
+++ /dev/null
@@ -1,297 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-import { connect } from 'react-redux';
-import { bindActionCreators } from 'redux';
-import { uniq, isEqual } from 'lodash';
-
-import { setVisibleAccounts } from '@parity/shared/redux/providers/personalActions';
-import { Actionbar, ActionbarExport, ActionbarImport, ActionbarSearch, ActionbarSort, Button, Page } from '@parity/ui';
-import { AddIcon } from '@parity/ui/Icons';
-
-import List from '@parity/dapp-accounts/List';
-import Summary from '@parity/dapp-accounts/Summary';
-
-import AddAddress from './AddAddress';
-
-import styles from './addresses.css';
-
-class Addresses extends Component {
- static contextTypes = {
- api: PropTypes.object
- }
-
- static propTypes = {
- setVisibleAccounts: PropTypes.func.isRequired,
-
- contacts: PropTypes.object,
- hasContacts: PropTypes.bool
- }
-
- state = {
- showAdd: false,
- sortOrder: '',
- searchValues: [],
- searchTokens: []
- }
-
- componentWillMount () {
- this.setVisibleAccounts();
- }
-
- componentWillReceiveProps (nextProps) {
- const prevAddresses = Object.keys(this.props.contacts);
- const nextAddresses = Object.keys(nextProps.contacts);
-
- if (prevAddresses.length !== nextAddresses.length || !isEqual(prevAddresses.sort(), nextAddresses.sort())) {
- this.setVisibleAccounts(nextProps);
- }
- }
-
- componentWillUnmount () {
- this.props.setVisibleAccounts([]);
- }
-
- setVisibleAccounts (props = this.props) {
- const { contacts, setVisibleAccounts } = props;
- const addresses = Object.keys(contacts);
-
- setVisibleAccounts(addresses);
- }
-
- render () {
- return (
-
- );
- } catch (e) {
- return error;
- }
- }
-
- onImport = (content) => {
- try {
- const addresses = JSON.parse(content);
-
- Object.values(addresses).forEach((account) => {
- this.onAddAccount(account);
- });
- } catch (e) {
- console.error('onImport', content, e);
- }
- }
-
- onAddAccount = (account) => {
- const { api } = this.context;
- const { address, name, meta } = account;
-
- Promise.all([
- api.parity.setAccountName(address, name),
- api.parity.setAccountMeta(address, {
- ...meta,
- timestamp: Date.now(),
- deleted: false
- })
- ]).catch((error) => {
- console.error('onAddAccount', error);
- });
- }
-
- onAddSearchToken = (token) => {
- const { searchTokens } = this.state;
- const newSearchTokens = uniq([].concat(searchTokens, token));
-
- this.setState({ searchTokens: newSearchTokens });
- }
-
- onOpenAdd = () => {
- this.setState({
- showAdd: true
- });
- }
-
- onCloseAdd = () => {
- this.setState({ showAdd: false });
- }
-}
-
-function mapStateToProps (state) {
- const { contacts, hasContacts } = state.personal;
-
- return {
- contacts,
- hasContacts
- };
-}
-
-function mapDispatchToProps (dispatch) {
- return bindActionCreators({
- setVisibleAccounts
- }, dispatch);
-}
-
-export default connect(
- mapStateToProps,
- mapDispatchToProps
-)(Addresses);
diff --git a/js/packages/dapp-addresses/api.js b/js/packages/dapp-addresses/api.js
deleted file mode 100644
index b2e52cca0..000000000
--- a/js/packages/dapp-addresses/api.js
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import Api from '@parity/api';
-
-const ethereumProvider = window.ethereum || window.parent.ethereum;
-
-if (!ethereumProvider) {
- throw new Error('Unable to locate EthereumProvider, object not attached');
-}
-
-export default new Api(ethereumProvider);
diff --git a/js/packages/dapp-addresses/index.js b/js/packages/dapp-addresses/index.js
deleted file mode 100644
index 225c36c80..000000000
--- a/js/packages/dapp-addresses/index.js
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import ReactDOM from 'react-dom';
-import React from 'react';
-import { Route, Router, hashHistory } from 'react-router';
-
-import injectTapEventPlugin from 'react-tap-event-plugin';
-injectTapEventPlugin();
-
-import ContractInstances from '@parity/shared/contracts';
-import { initStore } from '@parity/shared/redux';
-import ContextProvider from '@parity/ui/ContextProvider';
-
-import api from './api';
-import Addresses from './addresses';
-
-ContractInstances.get(api);
-
-const store = initStore(api, hashHistory);
-
-ReactDOM.render(
-
-
-
-
- ,
- document.querySelector('#container')
-);
diff --git a/js/packages/dapp-addresses/package.json b/js/packages/dapp-addresses/package.json
deleted file mode 100644
index 0d4e799a0..000000000
--- a/js/packages/dapp-addresses/package.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "name": "@parity/dapp-addresses",
- "description": "Parity default addressbook view",
- "version": "1.99.99",
- "main": "index.js",
- "author": "Parity Team ",
- "maintainers": [],
- "contributors": [],
- "license": "GPL-3.0",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/paritytech/dapp-addresses.git"
- },
- "keywords": [],
- "scripts": {},
- "devDependencies": {},
- "dependencies": {},
- "peerDependencies": {}
-}
diff --git a/js/packages/dapp-chaindeploy/Application/application.css b/js/packages/dapp-chaindeploy/Application/application.css
deleted file mode 100644
index f6db5da29..000000000
--- a/js/packages/dapp-chaindeploy/Application/application.css
+++ /dev/null
@@ -1,78 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.body {
- font-size: 0.8em;
-
- .buttons {
- position: fixed;
- right: 0.5em;
- top: 0.5em;
- z-index: 100;
-
- button {
- background: rgb(0, 200, 255);
- border: 2px solid rgba(0, 200, 255, 0.5);
- border-radius: 0.25em;
- color: white;
- cursor: pointer;
- font-size: 1em;
- margin: 0 0 0 0.5em;
- outline: none;
- padding: 0.75em 1.5em;
- white-space: nowrap;
-
- &:disabled {
- background: rgb(230, 230, 230);
- border: 2px solid rgba(230, 230, 230, 0.5);
- cursor: default;
- }
-
- .icon {
- fill: white !important;
- margin-right: 0.5em;
- }
-
- .text {
- display: inline-block;
- line-height: 24px;
- vertical-align: top;
- }
- }
- }
-
- .section {
- margin: 0 1em 3em 1em;
-
- h3 {
- background: rgba(0, 0, 0, 0.025);
- border-radius: 0.25em;
- padding: 0.75em 1em;
- margin-bottom: 0.5em;
-
- small {
- vertical-align: middle;
- }
- }
-
- .list {
- display: flex;
- flex-direction: row;
- flex-wrap: wrap;
- }
- }
-}
diff --git a/js/packages/dapp-chaindeploy/Application/application.js b/js/packages/dapp-chaindeploy/Application/application.js
deleted file mode 100644
index 9e6fa588f..000000000
--- a/js/packages/dapp-chaindeploy/Application/application.js
+++ /dev/null
@@ -1,178 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { observer } from 'mobx-react';
-import React, { Component } from 'react';
-
-import Contract from '../Contract';
-import Dapp from '../Dapp';
-import Store from '../store';
-
-import styles from './application.css';
-
-@observer
-export default class Application extends Component {
- store = new Store();
-
- render () {
- return (
-
- );
- }
-
- deployApps = () => {
- return this.store.deployApps();
- }
-
- deployBadges = () => {
- return this.store.deployBadges();
- }
-
- deployContracts = () => {
- return this.store.deployContracts();
- }
-
- deployRegistry = () => {
- return this.store.deployRegistry();
- }
-}
diff --git a/js/packages/dapp-chaindeploy/Application/index.js b/js/packages/dapp-chaindeploy/Application/index.js
deleted file mode 100644
index 3d8d1ca3b..000000000
--- a/js/packages/dapp-chaindeploy/Application/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './application';
diff --git a/js/packages/dapp-chaindeploy/Contract/contract.js b/js/packages/dapp-chaindeploy/Contract/contract.js
deleted file mode 100644
index 0be51fbf2..000000000
--- a/js/packages/dapp-chaindeploy/Contract/contract.js
+++ /dev/null
@@ -1,133 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-
-import ListItem, { Header, Row } from '../ListItem';
-
-export default class Contract extends Component {
- static propTypes = {
- contract: PropTypes.object.isRequired,
- disabled: PropTypes.bool
- }
-
- render () {
- const { contract, disabled } = this.props;
- const location = contract.id === 'registry'
- ? 'chain'
- : 'registry';
-
- return (
-
-
- { contract.id } was {
- contract.address
- ? 'deployed'
- : 'not found'
- }
-
-
- {
- contract.address
- ? contract.address
- : 'no address'
- }
-
-
- {
- contract.hasLatestCode
- ? 'has latest available code'
- : 'does not have latest code'
- }
-
-
- {
- contract.isOnChain
- ? `registered on ${location}`
- : `not registered on ${location}`
- }
-
- { this.renderBadgeInfo() }
-
- );
- }
-
- renderBadgeInfo () {
- const { contract } = this.props;
-
- if (!contract.isBadge) {
- return null;
- }
-
- return [
-
- {
- contract.isBadgeRegistered
- ? 'found in badgereg'
- : 'not found in badgereg'
- }
- ,
-
- {
- contract.badgeImageHash
- ? `badge imageHash ${contract.badgeImageHash}`
- : 'has not registered a badge imageHash'
- }
- ,
-
- {
- contract.badgeImageMatch
- ? 'has latest badge imageHash'
- : 'does not have latest badge imageHash'
- }
-
- ];
- }
-}
diff --git a/js/packages/dapp-chaindeploy/Contract/index.js b/js/packages/dapp-chaindeploy/Contract/index.js
deleted file mode 100644
index 74c58e942..000000000
--- a/js/packages/dapp-chaindeploy/Contract/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './contract';
diff --git a/js/packages/dapp-chaindeploy/Dapp/dapp.js b/js/packages/dapp-chaindeploy/Dapp/dapp.js
deleted file mode 100644
index 934eb34f4..000000000
--- a/js/packages/dapp-chaindeploy/Dapp/dapp.js
+++ /dev/null
@@ -1,99 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-
-import ListItem, { Header, Row } from '../ListItem';
-
-export default class Dapp extends Component {
- static propTypes = {
- dapp: PropTypes.object.isRequired,
- disabled: PropTypes.bool
- }
-
- render () {
- const { dapp, disabled } = this.props;
-
- return (
-
-
- { dapp.name }
-
-
- {
- dapp.isOnChain
- ? 'found in dappreg'
- : 'not found in dappreg'
- }
-
- { this.renderHash(dapp, 'image') }
- { this.renderHash(dapp, 'manifest') }
- { this.renderHash(dapp, 'content') }
-
- );
- }
-
- renderHash (dapp, type) {
- if (!dapp.source[`${type}Hash`]) {
- return null;
- }
-
- const isMatch = dapp[`${type}Match`];
- const hash = dapp[`${type}Hash`];
-
- return [
-
- {
- hash
- ? `${type}Hash ${hash}`
- : `has not registered an ${type}Hash`
- }
- ,
-
- {
- isMatch
- ? `has latest ${type}Hash`
- : `does not have latest ${type}Hash`
- }
-
- ];
- }
-}
diff --git a/js/packages/dapp-chaindeploy/Dapp/index.js b/js/packages/dapp-chaindeploy/Dapp/index.js
deleted file mode 100644
index 3d3281389..000000000
--- a/js/packages/dapp-chaindeploy/Dapp/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './dapp';
diff --git a/js/packages/dapp-chaindeploy/ListItem/Header/header.js b/js/packages/dapp-chaindeploy/ListItem/Header/header.js
deleted file mode 100644
index efb8ec705..000000000
--- a/js/packages/dapp-chaindeploy/ListItem/Header/header.js
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-
-import Icon from '../Icon';
-
-import styles from '../listItem.css';
-
-export default class Header extends Component {
- static propTypes = {
- children: PropTypes.node.isRequired,
- isBusy: PropTypes.bool,
- isOk: PropTypes.bool
- }
-
- render () {
- const { children, isBusy, isOk } = this.props;
-
- return (
-
-
-
- { children }
-
-
- );
- }
-}
diff --git a/js/packages/dapp-chaindeploy/ListItem/Header/index.js b/js/packages/dapp-chaindeploy/ListItem/Header/index.js
deleted file mode 100644
index aef90266f..000000000
--- a/js/packages/dapp-chaindeploy/ListItem/Header/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './header';
diff --git a/js/packages/dapp-chaindeploy/ListItem/Icon/icon.js b/js/packages/dapp-chaindeploy/ListItem/Icon/icon.js
deleted file mode 100644
index 25a0e5511..000000000
--- a/js/packages/dapp-chaindeploy/ListItem/Icon/icon.js
+++ /dev/null
@@ -1,54 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-
-import styles from '../listItem.css';
-
-export default class Icon extends Component {
- static propTypes = {
- isBusy: PropTypes.bool,
- isOk: PropTypes.bool
- }
-
- render () {
- const { isBusy, isOk } = this.props;
-
- return (
-
- );
- }
-}
diff --git a/js/packages/dapp-chaindeploy/ListItem/Icon/index.js b/js/packages/dapp-chaindeploy/ListItem/Icon/index.js
deleted file mode 100644
index f43e02c49..000000000
--- a/js/packages/dapp-chaindeploy/ListItem/Icon/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './icon';
diff --git a/js/packages/dapp-chaindeploy/ListItem/Row/index.js b/js/packages/dapp-chaindeploy/ListItem/Row/index.js
deleted file mode 100644
index 5f2c62dee..000000000
--- a/js/packages/dapp-chaindeploy/ListItem/Row/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './row';
diff --git a/js/packages/dapp-chaindeploy/ListItem/Row/row.js b/js/packages/dapp-chaindeploy/ListItem/Row/row.js
deleted file mode 100644
index 8e65686cd..000000000
--- a/js/packages/dapp-chaindeploy/ListItem/Row/row.js
+++ /dev/null
@@ -1,55 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-
-import Icon from '../Icon';
-
-import styles from '../listItem.css';
-
-export default class Row extends Component {
- static propTypes = {
- children: PropTypes.node.isRequired,
- disabled: PropTypes.bool,
- isBusy: PropTypes.bool,
- isOk: PropTypes.bool
- }
-
- render () {
- const { children, disabled, isBusy, isOk } = this.props;
-
- return (
-
-
-
- { children }
-
-
- );
- }
-}
diff --git a/js/packages/dapp-chaindeploy/ListItem/index.js b/js/packages/dapp-chaindeploy/ListItem/index.js
deleted file mode 100644
index 7c79e3241..000000000
--- a/js/packages/dapp-chaindeploy/ListItem/index.js
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export Header from './Header';
-export Row from './Row';
-
-export default from './listItem';
diff --git a/js/packages/dapp-chaindeploy/ListItem/listItem.css b/js/packages/dapp-chaindeploy/ListItem/listItem.css
deleted file mode 100644
index 47d6d481d..000000000
--- a/js/packages/dapp-chaindeploy/ListItem/listItem.css
+++ /dev/null
@@ -1,94 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.listItem {
- box-sizing: border-box;
- flex: 0 1 33.33%;
- max-width: 33.33%;
- padding: 0.5em;
- position: relative;
-
- .body {
- background: rgba(0, 0, 0, 0.025);
- border-radius: 0.25em;
- box-sizing: border-box;
- display: flex;
- flex-direction: column;
- flex-wrap: nowrap;
- overflow: hidden;
- padding: 0.75em;
- }
-
- .status {
- background: #f80;
- border-radius: 0.25em;
- color: white;
- font-size: 0.75em;
- line-height: 1em;
- opacity: 0.9;
- padding: 0.5em;
- position: absolute;
- right: 1em;
- top: 1em;
- }
-}
-
-.header,
-.details {
- display: flex;
- line-height: 1.5em;
- padding: 0.125em 0;
- position: relative;
- white-space: nowrap;
-
- .title {
- display: inline-block;
- overflow: hidden;
- text-overflow: ellipsis;
- vertical-align: top;
- }
-}
-
-.details {
- margin-left: 2em;
-}
-
-.icon {
- border-radius: 0.25em;
- display: inline-block;
- flex: 0 0 1.5em;
- height: 1.5em;
- margin-right: 0.5em;
- opacity: 0.75;
- text-align: center;
- vertical-align: middle;
- width: 1.5em;
-
- &.error {
- box-shadow: inset 0 0 0 2px rgb(200, 0, 0);
- color: rgb(200, 0, 0);
- }
-
- &.ok {
- box-shadow: inset 0 0 0 2px rgb(0, 200, 0);
- color: rgb(0, 200, 0);
- }
-}
-
-.muted {
- opacity: 0.25;
-}
diff --git a/js/packages/dapp-chaindeploy/ListItem/listItem.js b/js/packages/dapp-chaindeploy/ListItem/listItem.js
deleted file mode 100644
index 9738bf9dd..000000000
--- a/js/packages/dapp-chaindeploy/ListItem/listItem.js
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-
-import styles from './listItem.css';
-
-export default class ListItem extends Component {
- static propTypes = {
- children: PropTypes.node.isRequired,
- disabled: PropTypes.bool,
- status: PropTypes.string
- }
-
- render () {
- const { children, disabled } = this.props;
-
- return (
-
- );
- }
-}
diff --git a/js/packages/dapp-chaindeploy/_dapps.js b/js/packages/dapp-chaindeploy/_dapps.js
deleted file mode 100644
index 8f32bb5e1..000000000
--- a/js/packages/dapp-chaindeploy/_dapps.js
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import builtinsJson from '@parity/shared/config/dappsBuiltin.json';
-
-const REGISTER_URLS = {
- console: 'https://raw.githubusercontent.com/paritytech/console/3ea0dbfefded359ccdbea37bc4cf350c0aa16948/console.jpeg',
- dappreg: 'https://raw.githubusercontent.com/paritytech/dapp-assets/cdd6ac4f1e2f11619bed72a53ae71217dffe19ad/dapps/legos-64x64.png',
- githubhint: 'https://raw.githubusercontent.com/paritytech/dapp-assets/b88e983abaa1a6a6345b8d9448c15b117ddb540e/dapps/link-64x64.jpg',
- localtx: 'https://raw.githubusercontent.com/paritytech/dapp-assets/cdd6ac4f1e2f11619bed72a53ae71217dffe19ad/dapps/stack-64x64.png',
- registry: 'https://raw.githubusercontent.com/paritytech/dapp-assets/b88e983abaa1a6a6345b8d9448c15b117ddb540e/dapps/register-64x64.jpg',
- signaturereg: 'https://raw.githubusercontent.com/paritytech/dapp-assets/b88e983abaa1a6a6345b8d9448c15b117ddb540e/dapps/hex-64x64.jpg',
- tokendeploy: 'https://raw.githubusercontent.com/paritytech/dapp-assets/b88e983abaa1a6a6345b8d9448c15b117ddb540e/dapps/interlock-64x64.png',
- tokenreg: 'https://raw.githubusercontent.com/paritytech/dapp-assets/b88e983abaa1a6a6345b8d9448c15b117ddb540e/dapps/coins-64x64.jpg',
- web: 'https://raw.githubusercontent.com/paritytech/dapp-assets/ec6138115d0e1f45258969cd90b3b274e0ff2258/dapps/earth-64x64.jpg'
-};
-
-const builtins = builtinsJson
- .filter((app) => app.id)
- .map((app) => {
- app.source = {
- imageUrl: REGISTER_URLS[app.id]
- };
-
- return app;
- });
-
-export {
- builtins
-};
diff --git a/js/packages/dapp-chaindeploy/contracts/abi/jg-voting.json b/js/packages/dapp-chaindeploy/contracts/abi/jg-voting.json
deleted file mode 100644
index 83a07ef7c..000000000
--- a/js/packages/dapp-chaindeploy/contracts/abi/jg-voting.json
+++ /dev/null
@@ -1 +0,0 @@
-[{"constant":true,"inputs":[],"name":"count","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"totalVotes","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_newOwner","type":"address"}],"name":"setOwner","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"_index","type":"uint256"}],"name":"hasSenderVoted","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_index","type":"uint256"},{"name":"_answer","type":"uint256"}],"name":"newAnswer","outputs":[{"name":"","type":"bool"}],"payable":true,"type":"function"},{"constant":false,"inputs":[{"name":"_fee","type":"uint256"}],"name":"setQuestionFee","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"questionFee","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"_index","type":"uint256"}],"name":"get","outputs":[{"name":"closed","type":"bool"},{"name":"owner","type":"address"},{"name":"question","type":"string"},{"name":"balanceNo","type":"uint256"},{"name":"balanceYes","type":"uint256"},{"name":"balanceMaybe","type":"uint256"},{"name":"votesNo","type":"uint256"},{"name":"votesYes","type":"uint256"},{"name":"votesMaybe","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"drain","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_question","type":"string"}],"name":"newQuestion","outputs":[{"name":"","type":"bool"}],"payable":true,"type":"function"},{"constant":true,"inputs":[],"name":"totalBalance","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"answerFee","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_index","type":"uint256"}],"name":"closeQuestion","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_fee","type":"uint256"}],"name":"setAnswerFee","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"inputs":[],"payable":false,"type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"},{"indexed":true,"name":"index","type":"uint256"},{"indexed":false,"name":"question","type":"string"}],"name":"NewQuestion","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"index","type":"uint256"},{"indexed":true,"name":"answer","type":"uint256"},{"indexed":false,"name":"value","type":"uint256"}],"name":"NewAnswer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"old","type":"address"},{"indexed":true,"name":"current","type":"address"}],"name":"NewOwner","type":"event"}]
diff --git a/js/packages/dapp-chaindeploy/contracts/badgereg.js b/js/packages/dapp-chaindeploy/contracts/badgereg.js
deleted file mode 100644
index 2a1dc4012..000000000
--- a/js/packages/dapp-chaindeploy/contracts/badgereg.js
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import abi from '@parity/shared/contracts/abi/badgereg';
-
-import { compiler, source as sourceUrl, output as byteCode } from './code/badgereg';
-
-const id = 'badgereg';
-const deployParams = [];
-
-export {
- abi,
- byteCode,
- compiler,
- deployParams,
- id,
- sourceUrl
-};
diff --git a/js/packages/dapp-chaindeploy/contracts/code/badgereg.json b/js/packages/dapp-chaindeploy/contracts/code/badgereg.json
deleted file mode 100644
index e7801722a..000000000
--- a/js/packages/dapp-chaindeploy/contracts/code/badgereg.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "compiler": "v0.4.9+commit.364da425",
- "source": "https://github.com/paritytech/contracts/blob/58842b92c00e3c45a84b6d0ac9b842f016dde50a/BadgeReg.sol",
- "output": "0x606060405260008054600160a060020a03191633600160a060020a0316179055670de0b6b3a7640000600455341561003357fe5b5b610a6f806100436000396000f300606060405236156100bf5763ffffffff60e060020a60003504166313af403581146100c15780631e7a505f146100df5780632c0f5f591461010a5780635b8066451461014557806369fe0e2d146101675780637958533a1461017c5780638da5cb5b146101a45780639890220b146101d0578063a02b161e146101e2578063ac4ce2c6146101f7578063b72e717d14610218578063c0f6faed1461025b578063dd93890b14610299578063ddbcb5cb146102b4578063ddca3f43146102e6575bfe5b34156100c957fe5b6100dd600160a060020a0360043516610308565b005b6100f6600160a060020a036004351660243561037c565b604080519115158252519081900360200190f35b341561011257fe5b61011d600435610392565b60408051938452600160a060020a039283166020850152911682820152519081900360600190f35b341561014d57fe5b6101556103ef565b60408051918252519081900360200190f35b341561016f57fe5b6100dd6004356103f6565b005b341561018457fe5b61015560043560243561041b565b60408051918252519081900360200190f35b34156101ac57fe5b6101b461045a565b60408051600160a060020a039092168252519081900360200190f35b34156101d857fe5b6100dd610469565b005b34156101ea57fe5b6100dd6004356104bc565b005b34156101ff57fe5b6100dd600435600160a060020a03602435166105ee565b005b341561022057fe5b610234600160a060020a0360043516610721565b604080519384526020840192909252600160a060020a031682820152519081900360600190f35b341561026357fe5b61026e600435610789565b60408051600160a060020a039485168152602081019390935292168183015290519081900360600190f35b34156102a157fe5b6100dd6004356024356044356107dc565b005b6100f6600160a060020a036004358116906024359060443516610899565b604080519115158252519081900360200190f35b34156102ee57fe5b6101556109cc565b60408051918252519081900360200190f35b60005433600160a060020a0390811691161461032357610378565b60008054604051600160a060020a03808516939216917f70aea8d848e8a90fb7661b227dc522eb6395c3dac71b63cb59edd5c9899b236491a360008054600160a060020a031916600160a060020a0383161790555b5b50565b6000610389838333610899565b90505b92915050565b60008181526002602052604081205460038054600019909201929182918291859081106103bb57fe5b906000526020600020906004020160005b5080546002820154600160a060020a03918216955016925090505b509193909250565b6003545b90565b60005433600160a060020a0390811691161461041157610378565b60048190555b5b50565b600060038381548110151561042c57fe5b906000526020600020906004020160005b506000838152600391909101602052604090205490505b92915050565b600054600160a060020a031681565b60005433600160a060020a03908116911614610484576104b8565b604051600160a060020a0333811691309091163180156108fc02916000818181858888f1935050505015156104b857610000565b5b5b565b60005433600160a060020a039081169116146104d757610378565b806003828154811015156104e757fe5b906000526020600020906004020160005b50600101546040517f844e89a9d524dabb877007aa0e9c395e8938fcfee93ece70c2cd0353db79c8e590600090a36001600060038381548110151561053957fe5b906000526020600020906004020160005b5054600160a060020a03168152602081019190915260400160009081208190556003805460029291908490811061057d57fe5b906000526020600020906004020160005b50600101548152602081019190915260400160009081205560038054829081106105b457fe5b906000526020600020906004020160005b508054600160a060020a03199081168255600060018301556002909101805490911690555b5b50565b60008233600160a060020a031660038281548110151561060a57fe5b906000526020600020906004020160005b5060020154600160a060020a0316146106335761071b565b600160a060020a03831660009081526001602052604090205483901561065857610718565b600380548690811061066657fe5b906000526020600020906004020160005b505460038054600160a060020a03909216945085918790811061069657fe5b906000526020600020906004020160005b508054600160a060020a031916600160a060020a039283161790558381166000908152600160209081526040808320839055928716808352918390208890558251918252915187927fa5d871c0e725767cd5aefc99c53aeca35f09dcc268145cbb13b74a7e2f48f196928290030190a25b5b505b50505050565b600160a060020a038116600090815260016020526040812054600380546000199092019291829182918590811061075457fe5b906000526020600020906004020160005b5060018101546002820154909450600160a060020a0316925090505b509193909250565b60006000600060006003858154811015156107a057fe5b906000526020600020906004020160005b50805460018201546002830154600160a060020a03928316975090955016925090505b509193909250565b8233600160a060020a03166003828154811015156107f657fe5b906000526020600020906004020160005b5060020154600160a060020a03161461081f5761071b565b8160038581548110151561082f57fe5b906000526020600020906004020160005b50600085815260039190910160209081526040918290209290925580518481529051859287927f7991c63a749706fd298fc2387764d640be6e714307b6357b1d3c2ce35cba3b52929081900390910190a35b5b50505050565b60006004543410156108aa576109c5565b600160a060020a0384166000908152600160205260409020548490156108cf576109c3565b6000848152600260205260409020548490156108ea576109c0565b60038054600181016108fc83826109d2565b916000526020600020906004020160005b5060408051606081018252600160a060020a03808b1680835260208084018c9052918a169284018390528454600160a060020a03199081168217865560018087018d905560029687018054909216909417905560035460008281529383528484208190558b8452948252918390208490558251918252915160001993909301935088927febbfb6376bef000063e6e33494e4c543a6197091a04eb6a6f55013d85a1c5386929181900390910190a3600192505b5b505b505b9392505050565b60045481565b8154818355818115116109fe576004028160040283600052602060002091820191016109fe9190610a04565b5b505050565b6103f391905b80821115610a3c578054600160a060020a03199081168255600060018301556002820180549091169055600401610a0a565b5090565b905600a165627a7a72305820526fc95faec325cec5dd3e1bb67c165265282c5fc6db21e96197060b823aaa490029"
-}
diff --git a/js/packages/dapp-chaindeploy/contracts/code/dappreg.json b/js/packages/dapp-chaindeploy/contracts/code/dappreg.json
deleted file mode 100644
index 48739a59d..000000000
--- a/js/packages/dapp-chaindeploy/contracts/code/dappreg.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "compiler": "v0.4.9+commit.364da425",
- "source": "https://github.com/paritytech/contracts/blob/225bf022ddd967af2b9ea188e8f611489ca5d7fe/DappReg.sol",
- "output": "0x606060405260008054600160a060020a03191633600160a060020a0316179055670de0b6b3a7640000600355341561003357fe5b5b6106ee806100436000396000f300606060405236156100a95763ffffffff60e060020a6000350416630257c48c81146100ab57806306661abd146100d357806313af4035146100f55780631a0919dc1461011357806369fe0e2d146101285780638da5cb5b1461013d5780638eaa6ac01461016957806391cd242d1461019d5780639890220b146101b8578063c52bd836146101ca578063ddca3f43146101eb578063e0886f901461020d578063e1fa8e8414610241575bfe5b34156100b357fe5b6100c160043560243561024e565b60408051918252519081900360200190f35b34156100db57fe5b6100c1610272565b60408051918252519081900360200190f35b34156100fd57fe5b610111600160a060020a0360043516610279565b005b341561011b57fe5b6101116004356102ed565b005b341561013057fe5b610111600435610388565b005b341561014557fe5b61014d6103ad565b60408051600160a060020a039092168252519081900360200190f35b341561017157fe5b61017c6004356103bc565b60408051928352600160a060020a0390911660208301528051918290030190f35b34156101a557fe5b6101116004356024356044356103e4565b005b34156101c057fe5b61011161046d565b005b34156101d257fe5b610111600435600160a060020a03602435166104c0565b005b34156101f357fe5b6100c161054e565b60408051918252519081900360200190f35b341561021557fe5b61017c600435610554565b60408051928352600160a060020a0390911660208301528051918290030190f35b6101116004356105ab565b005b60008281526001602090815260408083208484526002019091529020545b92915050565b6002545b90565b60005433600160a060020a0390811691161461029457610000565b60008054604051600160a060020a03808516939216917f70aea8d848e8a90fb7661b227dc522eb6395c3dac71b63cb59edd5c9899b236491a360008054600160a060020a031916600160a060020a0383161790555b5b50565b60008181526001602081905260409091200154819033600160a060020a0390811691161480159061032d575060005433600160a060020a03908116911614155b1561033757610000565b60008281526001602081905260408083208381559091018054600160a060020a03191690555183917fe17fec26316aebe957e188549d659a89f359c49766bcc0ae2fb7ded274ffe14691a25b5b5050565b60005433600160a060020a039081169116146103a357610000565b60038190555b5b50565b600054600160a060020a031681565b6000818152600160208190526040909120805491810154600160a060020a0316905b50915091565b60008381526001602081905260409091200154839033600160a060020a0390811691161461041157610000565b600084815260016020908152604080832086845260020182529182902084905581518481529151859287927f4dcd4fb147bb133a0da8fbf4e5fc3ddd64f04d4b3f6cbee584374b889d28c78d92918290030190a35b5b50505050565b60005433600160a060020a0390811691161461048857610000565b604051600160a060020a0333811691309091163180156108fc02916000818181858888f1935050505015156104bc57610000565b5b5b565b60008281526001602081905260409091200154829033600160a060020a039081169116146104ed57610000565b60008381526001602081905260408083209091018054600160a060020a031916600160a060020a0386169081179091559051909185917fd3d10d874a10020c2bce719499d1fd8756d880b128eb2945dd01b3830854e7169190a35b5b505050565b60035481565b6000600060006001600060028681548110151561056d57fe5b906000526020600020900160005b50548152602081019190915260400160002080546001820154909450600160a060020a0316925090505b50915091565b6003543410156105ba57610000565b6000818152600160205260409020548190156105d557610000565b60028054600181016105e78382610677565b916000526020600020900160005b508390555060408051808201825283815233600160a060020a0390811660208084018281526000888152600192839052868120955186559051949091018054600160a060020a0319169490931693909317909155915184917f7d917fcbc9a29a9705ff9936ffa599500e4fd902e4486bae317414fe967b307c91a35b5b505b50565b815481835581811511610548576000838152602090206105489181019083016106a1565b5b505050565b61027691905b808211156106bb57600081556001016106a7565b5090565b905600a165627a7a7230582011d8a45e381635e9de17e14cc4de97a1e17758cfac1fd25e8a5bc1d5f4d1da9d0029"
-}
diff --git a/js/packages/dapp-chaindeploy/contracts/code/gavcoin.json b/js/packages/dapp-chaindeploy/contracts/code/gavcoin.json
deleted file mode 100644
index f0ead4a35..000000000
--- a/js/packages/dapp-chaindeploy/contracts/code/gavcoin.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "compiler": "v0.4.9+commit.364da425",
- "source": "https://github.com/paritytech/contracts/blob/58842b92c00e3c45a84b6d0ac9b842f016dde50a/GavCoin.sol",
- "output": "0x606060405266038d7ea4c680006002556305f5e100600355341561001f57fe5b5b6108008061002f6000396000f300606060405236156100885763ffffffff60e060020a600035041663095ea7b3811461009f57806318160ddd146100d257806323b872dd146100f457806329cbdc861461012d57806355234ec0146101465780635af36e3e1461016857806370a0823114610192578063a035b1fe146101c0578063a9059cbb146101e2578063dd62ed3e14610215575b61009d5b61009a3360ff60020a610249565b5b565b005b34156100a757fe5b6100be600160a060020a0360043516602435610390565b604080519115158252519081900360200190f35b34156100da57fe5b6100e2610416565b60408051918252519081900360200190f35b34156100fc57fe5b6100be600160a060020a036004358116906024351660443561041c565b604080519115158252519081900360200190f35b61009d600160a060020a036004351660243561052a565b005b341561014e57fe5b6100e2610539565b60408051918252519081900360200190f35b341561017057fe5b6100be60043560243561053f565b604080519115158252519081900360200190f35b341561019a57fe5b6100e2600160a060020a03600435166106d0565b60408051918252519081900360200190f35b34156101c857fe5b6100e26106ef565b60408051918252519081900360200190f35b34156101ea57fe5b6100be600160a060020a03600435166024356106f5565b604080519115158252519081900360200190f35b341561021d57fe5b6100e2600160a060020a03600435811690602435166107a3565b60408051918252519081900360200190f35b34600080805b60008411801561026157508460025411155b1561038757600354600254620f424091025b0492508284116102835783610285565b825b9150600254620f4240830281151561029957fe5b33600160a060020a03166000818152600160208181526040808420805497909604968701865560028054855295830190915280832080548701905584548352808320909101805463ffffffff191662093a80420163ffffffff161790558154850182559254925193945084937f689dcb02b6a65e0e2f1d23ef47c1ec86604ffbed0bcb65f20150cfc7d5e5a9489190a4600380548290039081905593829003931515610382576002805466038d7ea4c6800001908190556305f5e1006003556040517f23c3dae768238f239632b5c4acb89485b440e0fa72481c4aad9f9b4f9b5a0a5f90600090a25b61024f565b5b505050505050565b600082600160a060020a031633600160a060020a03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a350600160a060020a0333811660009081526001602081815260408084209487168452600290940190529190208054830190555b92915050565b60005481565b600160a060020a038316600090815260016020526040812054849083908190101561044657610521565b600160a060020a0380871660009081526001602090815260408083203394851684526002019091529020548791908690819010156104835761051c565b87600160a060020a031689600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef896040518082815260200191505060405180910390a3600160a060020a03808a166000908152600160208181526040808420338616855260028101835281852080548e900390559183905281548c9003909155928b16825291902080548901905595505b5b5050505b50509392505050565b6105348282610249565b5b5050565b60035481565b600160a060020a0333166000908152600160208181526040808420868552909201905281205483908390819010806105a35750600160a060020a03331660009081526001602081815260408084208685528301909152909120015463ffffffff1642105b156105ad576106c8565b33600160a060020a0381166000908152600160205260409020548590819010156105d6576106c4565b60405186908890600160a060020a033316907f73f04af9dcc582a923ec15d3eea990fe34adabfff2879e28d44572e01a54abb690600090a433600160a060020a0316600090815260016020818152604080842080548b9003815584548b0185558b855290920190529020805487900390819055151561068457600160a060020a03331660009081526001602081815260408084208b85528301909152822091825501805463ffffffff191690555b600160a060020a0333166108fc620f4240888a025b604051919004801590920291906000818181858888f1935050505015156106bf57610000565b600194505b5b50505b505092915050565b600160a060020a0381166000908152600160205260409020545b919050565b60025481565b33600160a060020a038116600090815260016020526040812054909190839081901015610721576106c8565b84600160a060020a031633600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3600160a060020a03338116600090815260016020526040808220805488900390559187168152208054850190555b5b505092915050565b600160a060020a03808316600090815260016020908152604080832093851683526002909301905220545b929150505600a165627a7a72305820ca533a37c92e41888bda66ae0e66415d21a61c60027b269bca633d85b727875c0029"
-}
diff --git a/js/packages/dapp-chaindeploy/contracts/code/githubhint.json b/js/packages/dapp-chaindeploy/contracts/code/githubhint.json
deleted file mode 100644
index 3470ccef0..000000000
--- a/js/packages/dapp-chaindeploy/contracts/code/githubhint.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "compiler": "v0.4.9+commit.364da425",
- "source": "https://github.com/paritytech/contracts/blob/58842b92c00e3c45a84b6d0ac9b842f016dde50a/GithubHint.sol",
- "output": "0x6060604052341561000c57fe5b5b6105868061001c6000396000f300606060405263ffffffff60e060020a60003504166302f2008d81146100425780632196ae0d1461009b578063267b6922146101055780637c8c6643146101c9575bfe5b341561004a57fe5b60408051602060046024803582810135601f810185900485028601850190965285855261009995833595939460449493929092019181908401838280828437509496506101de95505050505050565b005b34156100a357fe5b60408051602060046024803582810135601f81018590048502860185019096528585526100999583359593946044949392909201918190840183828082843750949650505092356bffffffffffffffffffffffff191692506102be915050565b005b341561010d57fe5b6101186004356103b1565b604080516bffffffffffffffffffffffff1984166020820152600160a060020a03831691810191909152606080825284546002600019610100600184161502019091160490820181905281906080820190869080156101b85780601f1061018d576101008083540402835291602001916101b8565b820191906000526020600020905b81548152906001019060200180831161019b57829003601f168201915b505094505050505060405180910390f35b34156101d157fe5b6100996004356103de565b005b6000828152602081905260409020600201548290600160a060020a031615801590610227575060008181526020819052604090206002015433600160a060020a03908116911614155b15610231576102b8565b6040805160608101825283815260006020808301829052600160a060020a0333168385015286825281815292902081518051929391926102749284920190610472565b506020820151600182018054606060020a909204600160a060020a031992831617905560409092015160029091018054600160a060020a0392909216919092161790555b5b505050565b6000838152602081905260409020600201548390600160a060020a031615801590610307575060008181526020819052604090206002015433600160a060020a03908116911614155b15610311576103aa565b604080516060810182528481526bffffffffffffffffffffffff198416602080830191909152600160a060020a0333168284015260008781528082529290922081518051929391926103669284920190610472565b506020820151600182018054606060020a909204600160a060020a031992831617905560409092015160029091018054600160a060020a0392909216919092161790555b5b50505050565b600060208190529081526040902060018101546002820154606060020a90910290600160a060020a031683565b6000818152602081905260409020600201548190600160a060020a031615801590610427575060008181526020819052604090206002015433600160a060020a03908116911614155b156104315761046d565b60008281526020819052604081209061044a82826104f1565b50600181018054600160a060020a03199081169091556002909101805490911690555b5b5050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106104b357805160ff19168380011785556104e0565b828001600101855582156104e0579182015b828111156104e05782518255916020019190600101906104c5565b5b506104ed929150610539565b5090565b50805460018160011615610100020316600290046000825580601f106105175750610535565b601f0160209004906000526020600020908101906105359190610539565b5b50565b61055791905b808211156104ed576000815560010161053f565b5090565b905600a165627a7a72305820a83571409e7b0cc4fe48edd09087f315930ab4e017c62b6d100462285a8f4ae70029"
-}
diff --git a/js/packages/dapp-chaindeploy/contracts/code/jg-voting.json b/js/packages/dapp-chaindeploy/contracts/code/jg-voting.json
deleted file mode 100644
index 08ec4d0ed..000000000
--- a/js/packages/dapp-chaindeploy/contracts/code/jg-voting.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "compiler": "v0.4.9+commit.364da425",
- "source": "https://github.com/jacogr/dapp-voting/blob/9b20754b13b9a387704c0955d88b51d2e0e1896d/src/solidity/Voting.sol",
- "output": "0x606060405260008054600160a060020a03191633600160a060020a0316178155600281905560038190556004556611c37937e0800060055534156200004057fe5b5b60408051808201909152600781527f48756e6772793f0000000000000000000000000000000000000000000000000060208201526200008e906401000000006200090a6200009682021704565b505b620003af565b60008054819033600160a060020a03908116911614801590620000ba575060055434105b15620000c65762000000565b82600481511080620000d9575060a08151115b15620000e55762000000565b60018054925082810190620000fb908262000244565b50336001838154811015156200010d57fe5b906000526020600020906005020160005b508054600160a060020a03929092166101000261010060a860020a031990921691909117905560018054859190849081106200015657fe5b906000526020600020906005020160005b5060010190805190602001906200018092919062000279565b508133600160a060020a03167f7793f929911ad07e07894a20378f1eccce0fb493486c569d74045731fb583b8e866040518080602001828103825283818151815260200191508051906020019080838360008314620001fc575b805182526020831115620001fc57601f199092019160209182019101620001da565b505050905090810190601f168015620002295780820380516001836020036101000a031916815260200191505b509250505060405180910390a3600192505b5b505b50919050565b8154818355818115116200027357600502816005028360005260206000209182019101620002739190620002ff565b5b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10620002bc57805160ff1916838001178555620002ec565b82800160010185558215620002ec579182015b82811115620002ec578251825591602001919060010190620002cf565b5b50620002fb9291506200033f565b5090565b6200033c91905b80821115620002fb578054600160a860020a031916815560006200032e600183018262000363565b5060050162000306565b5090565b90565b6200033c91905b80821115620002fb576000815560010162000346565b5090565b90565b50805460018160011615610100020316600290046000825580601f106200038b5750620003ab565b601f016020900490600052602060002090810190620003ab91906200033f565b5b50565b610d2f80620003bf6000396000f300606060405236156100bf5763ffffffff60e060020a60003504166306661abd81146100c15780630d15fd77146100e357806313af40351461010557806331d3164714610123578063476c494c1461014a5780634df6ca2a1461016c5780638a55b54d146101935780638da5cb5b146101b55780639507d39a146101e15780639890220b146102c7578063a3f66b46146102eb578063ad7a672f1461034d578063bd12b4b51461036f578063c09f32e814610391578063f41c1c93146103b8575bfe5b34156100c957fe5b6100d16103df565b60408051918252519081900360200190f35b34156100eb57fe5b6100d16103e6565b60408051918252519081900360200190f35b341561010d57fe5b610121600160a060020a03600435166103ec565b005b341561012b57fe5b61013660043561046d565b604080519115158252519081900360200190f35b6101366004356024356104b8565b604080519115158252519081900360200190f35b341561017457fe5b6101366004356106c3565b604080519115158252519081900360200190f35b341561019b57fe5b6100d16106ee565b60408051918252519081900360200190f35b34156101bd57fe5b6101c56106f4565b60408051600160a060020a039092168252519081900360200190f35b34156101e957fe5b6101f4600435610703565b604051808a15151515815260200189600160a060020a0316600160a060020a0316815260200180602001888152602001878152602001868152602001858152602001848152602001838152602001828103825289818151815260200191508051906020019080838360008314610285575b80518252602083111561028557601f199092019160209182019101610265565b505050905090810190601f1680156102b15780820380516001836020036101000a031916815260200191505b509a505050505050505050505060405180910390f35b34156102cf57fe5b6101366108b2565b604080519115158252519081900360200190f35b610136600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284375094965061090a95505050505050565b604080519115158252519081900360200190f35b341561035557fe5b6100d1610ab5565b60408051918252519081900360200190f35b341561037757fe5b6100d1610abb565b60408051918252519081900360200190f35b341561039957fe5b610136600435610ac1565b604080519115158252519081900360200190f35b34156103c057fe5b610136600435610b63565b604080519115158252519081900360200190f35b6001545b90565b60035481565b60005433600160a060020a0390811691161461040757610000565b60008054604051600160a060020a03808516939216917f70aea8d848e8a90fb7661b227dc522eb6395c3dac71b63cb59edd5c9899b236491a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b600060018281548110151561047e57fe5b906000526020600020906005020160005b50600160a060020a0333166000908152600491909101602052604090205460ff1690505b919050565b6000805433600160a060020a039081169116148015906104d9575060045434105b156104e357610000565b600154839081106104f357610000565b8360018181548110151561050357fe5b906000526020600020906005020160005b505460ff1615156001141561052857610000565b8460018181548110151561053857fe5b906000526020600020906005020160005b50600160a060020a0333166000908152600491909101602052604090205460ff1615156001141561057957610000565b84600281111561058857610000565b60038054600190810190915560028054600160a060020a0333163101905580548190899081106105b457fe5b906000526020600020906005020160005b5033600160a060020a031660008181526004929092016020526040909120805460ff191692151592909217909155600180549131918990811061060457fe5b906000526020600020906005020160005b50600088815260029190910160205260409020805490910190556001805481908990811061063f57fe5b906000526020600020906005020160005b506000888152600391909101602090815260409182902080549093019092558051600160a060020a033316318152905188928a927f8b8ed2ef61b90da02f78bd8647287f46833d5b11467db4451e5c4b165485bf46929081900390910190a3600194505b5b505b505b505b505b92915050565b6000805433600160a060020a039081169116146106df57610000565b50600581905560015b5b919050565b60055481565b600054600160a060020a031681565b6000600061070f610b8e565b600060006000600060006000600060018b81548110151561072c57fe5b906000526020600020906005020160005b5090508060000160009054906101000a900460ff1699508060000160019054906101000a9004600160a060020a03169850806001018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108065780601f106107db57610100808354040283529160200191610806565b820191906000526020600020905b8154815290600101906020018083116107e957829003601f168201915b505050505097508060020160006000815260200190815260200160002054965080600201600060018152602001908152602001600020549550806002016000600281526020019081526020016000205494508060030160006000815260200190815260200160002054935080600301600060018152602001908152602001600020549250806003016000600281526020019081526020016000205491505b509193959799909294969850565b6000805433600160a060020a039081169116146108ce57610000565b604051600160a060020a0333811691309091163180156108fc02916000818181858888f19350505050151561090257610000565b5060015b5b90565b60008054819033600160a060020a0390811691161480159061092d575060055434105b1561093757610000565b82600481511080610949575060a08151115b1561095357610000565b600180549250828101906109679082610ba0565b503360018381548110151561097857fe5b906000526020600020906005020160005b508054600160a060020a03929092166101000274ffffffffffffffffffffffffffffffffffffffff001990921691909117905560018054859190849081106109cd57fe5b906000526020600020906005020160005b5060010190805190602001906109f5929190610bd2565b508133600160a060020a03167f7793f929911ad07e07894a20378f1eccce0fb493486c569d74045731fb583b8e866040518080602001828103825283818151815260200191508051906020019080838360008314610a6e575b805182526020831115610a6e57601f199092019160209182019101610a4e565b505050905090810190601f168015610a9a5780820380516001836020036101000a031916815260200191505b509250505060405180910390a3600192505b5b505b50919050565b60025481565b60045481565b60008133600160a060020a0316600182815481101515610add57fe5b906000526020600020906005020160005b50546101009004600160a060020a031614801590610b1b575060005433600160a060020a03908116911614155b15610b2557610000565b6001600184815481101515610b3657fe5b906000526020600020906005020160005b50805460ff1916911515919091179055600191505b5b50919050565b6000805433600160a060020a03908116911614610b7f57610000565b50600481905560015b5b919050565b60408051602081019091526000815290565b815481835581811511610bcc57600502816005028360005260206000209182019101610bcc9190610c51565b5b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10610c1357805160ff1916838001178555610c40565b82800160010185558215610c40579182015b82811115610c40578251825591602001919060010190610c25565b5b50610c4d929150610c9a565b5090565b6103e391905b80821115610c4d57805474ffffffffffffffffffffffffffffffffffffffffff191681556000610c8a6001830182610cbb565b50600501610c57565b5090565b90565b6103e391905b80821115610c4d5760008155600101610ca0565b5090565b90565b50805460018160011615610100020316600290046000825580601f10610ce15750610469565b601f0160209004906000526020600020908101906104699190610c9a565b5b505600a165627a7a72305820b084dcce4e3d78f8a86c925f6c3f2ed689e3674655482541076a1a22f6cdedad0029"
-}
diff --git a/js/packages/dapp-chaindeploy/contracts/code/registry.json b/js/packages/dapp-chaindeploy/contracts/code/registry.json
deleted file mode 100644
index 809e7bcfb..000000000
--- a/js/packages/dapp-chaindeploy/contracts/code/registry.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "compiler": "v0.4.9+commit.364da425",
- "source": "https://github.com/paritytech/contracts/blob/b1e0348144793e4ce6f7d6d2c4c7d0bb4ae9765e/SimpleRegistry.sol",
- "output": "0x606060405260008054600160a060020a03191633600160a060020a0316179055670de0b6b3a7640000600355341561003357fe5b5b611b2f806100436000396000f300606060405236156101225763ffffffff60e060020a60003504166306b2ff47811461012457806313af40351461015457806319362a28146101725780633f3935d1146101df578063432ced04146102495780634f39ca59146102685780636795dbcd1461028f57806369fe0e2d1461030257806379ce9fac146103295780638da5cb5b1461035c57806390b97fc11461038857806392698814146103f15780639890220b14610418578063ac4e73f91461043c578063ac72c120146104b1578063c3a3582514610388578063ddca3f4314610541578063deb931a214610563578063df57b74214610592578063e30bd740146105c1578063eadf976014610172578063ef5454d6146106ca578063f25eb5c11461073f578063f6d339e414610751575bfe5b341561012c57fe5b610140600160a060020a03600435166107c7565b604080519115158252519081900360200190f35b341561015c57fe5b610170600160a060020a03600435166107fa565b005b341561017a57fe5b60408051602060046024803582810135601f81018590048502860185019096528585526101409583359593946044949392909201918190840183828082843750949650509335935061086e92505050565b604080519115158252519081900360200190f35b34156101e757fe5b610140600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843750949650610a1495505050505050565b604080519115158252519081900360200190f35b610140600435610b6e565b604080519115158252519081900360200190f35b341561027057fe5b610140600435610c03565b604080519115158252519081900360200190f35b341561029757fe5b60408051602060046024803582810135601f81018590048502860185019096528585526102e69583359593946044949392909201918190840183828082843750949650610cc495505050505050565b60408051600160a060020a039092168252519081900360200190f35b341561030a57fe5b610140600435610d40565b604080519115158252519081900360200190f35b341561033157fe5b610140600435600160a060020a0360243516610d9e565b604080519115158252519081900360200190f35b341561036457fe5b6102e6610e2e565b60408051600160a060020a039092168252519081900360200190f35b341561039057fe5b60408051602060046024803582810135601f81018590048502860185019096528585526103df9583359593946044949392909201918190840183828082843750949650610cc495505050505050565b60408051918252519081900360200190f35b34156103f957fe5b610140600435610eb9565b604080519115158252519081900360200190f35b341561042057fe5b610140610ed9565b604080519115158252519081900360200190f35b341561044457fe5b610140600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284375094965050509235600160a060020a03169250610f6e915050565b604080519115158252519081900360200190f35b34156104b957fe5b6101406004356112ac565b604080519115158252519081900360200190f35b341561039057fe5b60408051602060046024803582810135601f81018590048502860185019096528585526103df9583359593946044949392909201918190840183828082843750949650610cc495505050505050565b60408051918252519081900360200190f35b341561054957fe5b6103df61134c565b60408051918252519081900360200190f35b341561056b57fe5b6102e6600435611352565b60408051600160a060020a039092168252519081900360200190f35b341561059a57fe5b6102e6600435611370565b60408051600160a060020a039092168252519081900360200190f35b34156105c957fe5b6105dd600160a060020a0360043516611392565b604080516020808252835181830152835191928392908301918501908083838215610623575b80518252602083111561062357601f199092019160209182019101610603565b505050905090810190601f16801561064f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561017a57fe5b60408051602060046024803582810135601f81018590048502860185019096528585526101409583359593946044949392909201918190840183828082843750949650509335935061086e92505050565b604080519115158252519081900360200190f35b34156106d257fe5b610140600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284375094965050509235600160a060020a031692506115e8915050565b604080519115158252519081900360200190f35b341561074757fe5b6101706116c6565b005b341561075957fe5b60408051602060046024803582810135601f8101859004850286018501909652858552610140958335959394604494939290920191819084018382808284375094965050509235600160a060020a0316925061185a915050565b604080519115158252519081900360200190f35b600160a060020a03811660009081526002602081905260409091205460001961010060018316150201160415155b919050565b60005433600160a060020a039081169116146108155761086a565b60008054604051600160a060020a03808516939216917f70aea8d848e8a90fb7661b227dc522eb6395c3dac71b63cb59edd5c9899b236491a360008054600160a060020a031916600160a060020a0383161790555b5b50565b600083815260016020526040812054849033600160a060020a0390811691161461089757610a0b565b6000858152600160209081526040918290209151865186936002019288929182918401908083835b602083106108de5780518252601f1990920191602091820191016108bf565b51815160209384036101000a60001901801990921691161790529201948552506040519384900381018420949094555050855186928291908401908083835b6020831061093c5780518252601f19909201916020918201910161091d565b51815160209384036101000a6000190180199092169116179052604080519290940182900382208183528a51838301528a519096508b95507fb829c3e412537bbe794c048ccb9e4605bb4aaaa8e4d4c15c1a6e0c2adc1716ea948b94508392908301919085019080838382156109cd575b8051825260208311156109cd57601f1990920191602091820191016109ad565b505050905090810190601f1680156109f95780820380516001836020036101000a031916815260200191505b509250505060405180910390a3600191505b5b509392505050565b60008133600160a060020a031660016000836040518082805190602001908083835b60208310610a555780518252601f199092019160209182019101610a36565b51815160209384036101000a6000190180199092169116179052604080519290940182900390912086528501959095529290920160002060010154600160a060020a0316939093149250610aab91505057610b67565b600160a060020a03331660009081526002602090815260409091208451610ad492860190611a09565b5033600160a060020a0316836040518082805190602001908083835b60208310610b0f5780518252601f199092019160209182019101610af0565b5181516020939093036101000a60001901801990911692169190911790526040519201829003822093507f098ae8581bb8bd9af1beaf7f2e9f51f31a8e5a8bfada4e303a645d71d9c9192092506000919050a3600191505b5b50919050565b6000818152600160205260408120548290600160a060020a031615610b9257610b67565b600354341015610ba157610b67565b6000838152600160205260408082208054600160a060020a03191633600160a060020a03169081179091559051909185917f4963513eca575aba66fdcd25f267aae85958fe6fb97e75fa25d783f1a091a2219190a3600191505b5b5b50919050565b600081815260016020526040812054829033600160a060020a03908116911614610c2c57610b67565b600083815260016020818152604080842090920154600160a060020a03168352600290528120610c5b91611a88565b60008381526001602081905260408083208054600160a060020a03199081168255920180549092169091555133600160a060020a03169185917fef1961b4d2909dc23643b309bfe5c3e5646842d98c3a58517037ef3871185af39190a3600191505b5b50919050565b600082815260016020908152604080832090518451600290920192859282918401908083835b60208310610d095780518252601f199092019160209182019101610cea565b51815160209384036101000a6000190180199092169116179052920194855250604051938490030190922054925050505b92915050565b6000805433600160a060020a03908116911614610d5c576107f5565b60038290556040805183815290517f6bbc57480a46553fa4d156ce702beef5f3ad66303b0ed1a5d4cb44966c6584c39181900360200190a15060015b5b919050565b600082815260016020526040812054839033600160a060020a03908116911614610dc757610e26565b6000848152600160205260408082208054600160a060020a031916600160a060020a0387811691821790925591519192339091169187917f7b97c62130aa09acbbcbf7482630e756592496f1759eaf702f469cf64dfb779491a4600191505b5b5092915050565b600054600160a060020a031681565b600082815260016020908152604080832090518451600290920192859282918401908083835b60208310610d095780518252601f199092019160209182019101610cea565b51815160209384036101000a6000190180199092169116179052920194855250604051938490030190922054925050505b92915050565b600081815260016020526040902054600160a060020a031615155b919050565b6000805433600160a060020a03908116911614610ef557610f6a565b60408051600160a060020a03301631815290517fdef931299fe61d176f949118058530c1f3f539dcb6950b4e372c9b835c33ca079181900360200190a1604051600160a060020a0333811691309091163180156108fc02916000818181858888f193505050501515610f6657610000565b5060015b5b90565b60006000836040518082805190602001908083835b60208310610fa25780518252601f199092019160209182019101610f83565b51815160209384036101000a6000190180199092169116179052604080519290940182900390912060008181526001909252929020549193505033600160a060020a039081169116149050610ff6576112a3565b846040518082805190602001908083835b602083106110265780518252601f199092019160209182019101611007565b51815160209384036101000a60001901801990921691161790526040805192909401829003909120600081815260019283905293909320015491955050600160a060020a03161580159250905061111257506000828152600160208181526040808420830154600160a060020a031684526002918290529283902092518354869493919283928592908116156101000260001901160480156110ff5780601f106110dd5761010080835404028352918201916110ff565b820191906000526020600020905b8154815290600101906020018083116110eb575b5050915050604051809103902060001916145b156111eb57600082815260016020818152604080842090920154600160a060020a0316835260029052812061114691611a88565b6000828152600160208181526040928390209091015491518751600160a060020a039093169288928291908401908083835b602083106111975780518252601f199092019160209182019101611178565b5181516020939093036101000a60001901801990911692169190911790526040519201829003822093507f12491ad95fd945e444d88a894ffad3c21959880a4dcd8af99d4ae4ffc71d4abd92506000919050a35b6000828152600160208181526040928390209091018054600160a060020a031916600160a060020a0388169081179091559151875188928291908401908083835b6020831061124b5780518252601f19909201916020918201910161122c565b5181516020939093036101000a60001901801990911692169190911790526040519201829003822093507f728435a0031f6a04538fcdd24922a7e06bc7bc945db03e83d22122d1bc5f28df92506000919050a3600192505b5b505092915050565b60008181526001602081905260409091200154600160a060020a031615155b919050565b600082815260016020908152604080832090518451600290920192859282918401908083835b60208310610d095780518252601f199092019160209182019101610cea565b51815160209384036101000a6000190180199092169116179052920194855250604051938490030190922054925050505b92915050565b60035481565b600081815260016020526040902054600160a060020a03165b919050565b60008181526001602081905260409091200154600160a060020a03165b919050565b61139a611ad0565b600160a060020a038216600090815260026020818152604092839020805484516001821615610100026000190190911693909304601f81018390048302840183019094528383529192908301828280156114355780601f1061140a57610100808354040283529160200191611435565b820191906000526020600020905b81548152906001019060200180831161141857829003601f168201915b505050505090505b919050565b600083815260016020526040812054849033600160a060020a0390811691161461089757610a0b565b6000858152600160209081526040918290209151865186936002019288929182918401908083835b602083106108de5780518252601f1990920191602091820191016108bf565b51815160209384036101000a60001901801990921691161790529201948552506040519384900381018420949094555050855186928291908401908083835b6020831061093c5780518252601f19909201916020918201910161091d565b51815160209384036101000a6000190180199092169116179052604080519290940182900382208183528a51838301528a519096508b95507fb829c3e412537bbe794c048ccb9e4605bb4aaaa8e4d4c15c1a6e0c2adc1716ea948b94508392908301919085019080838382156109cd575b8051825260208311156109cd57601f1990920191602091820191016109ad565b505050905090810190601f1680156109f95780820380516001836020036101000a031916815260200191505b509250505060405180910390a3600191505b5b509392505050565b6000805433600160a060020a0390811691161461160457610d3a565b600160a060020a0382166000908152600260209081526040909120845161162d92860190611a09565b5081600160a060020a0316836040518082805190602001908083835b602083106116685780518252601f199092019160209182019101611649565b5181516020939093036101000a60001901801990911692169190911790526040519201829003822093507f098ae8581bb8bd9af1beaf7f2e9f51f31a8e5a8bfada4e303a645d71d9c9192092506000919050a35060015b5b92915050565b33600160a060020a03166002600033600160a060020a0316600160a060020a0316815260200190815260200160002060405180828054600181600116156101000203166002900480156117505780601f1061172e576101008083540402835291820191611750565b820191906000526020600020905b81548152906001019060200180831161173c575b505060405190819003812092507f12491ad95fd945e444d88a894ffad3c21959880a4dcd8af99d4ae4ffc71d4abd9150600090a3600160006002600033600160a060020a0316600160a060020a0316815260200190815260200160002060405180828054600181600116156101000203166002900480156118085780601f106117e6576101008083540402835291820191611808565b820191906000526020600020905b8154815290600101906020018083116117f4575b50506040805191829003909120845260208085019590955292830160009081206001018054600160a060020a031916905533600160a060020a0316815260029094525050812061185791611a88565b5b565b600083815260016020526040812054849033600160a060020a0390811691161461188357610a0b565b60008581526001602090815260409182902091518651600160a060020a038716936002019288929182918401908083835b602083106108de5780518252601f1990920191602091820191016108bf565b51815160209384036101000a60001901801990921691161790529201948552506040519384900381018420949094555050855186928291908401908083835b6020831061093c5780518252601f19909201916020918201910161091d565b51815160209384036101000a6000190180199092169116179052604080519290940182900382208183528a51838301528a519096508b95507fb829c3e412537bbe794c048ccb9e4605bb4aaaa8e4d4c15c1a6e0c2adc1716ea948b94508392908301919085019080838382156109cd575b8051825260208311156109cd57601f1990920191602091820191016109ad565b505050905090810190601f1680156109f95780820380516001836020036101000a031916815260200191505b509250505060405180910390a3600191505b5b509392505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611a4a57805160ff1916838001178555611a77565b82800160010185558215611a77579182015b82811115611a77578251825591602001919060010190611a5c565b5b50611a84929150611ae2565b5090565b50805460018160011615610100020316600290046000825580601f10611aae575061086a565b601f01602090049060005260206000209081019061086a9190611ae2565b5b50565b60408051602081019091526000815290565b610f6a91905b80821115611a845760008155600101611ae8565b5090565b905600a165627a7a723058202a8f09bd2a20f43dfe4c6adb69bf4bfa211cda23787d972cd6e33eee989cafc50029"
-}
diff --git a/js/packages/dapp-chaindeploy/contracts/code/signaturereg.json b/js/packages/dapp-chaindeploy/contracts/code/signaturereg.json
deleted file mode 100644
index 3dd4fe07d..000000000
--- a/js/packages/dapp-chaindeploy/contracts/code/signaturereg.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "compiler": "v0.4.9+commit.364da425",
- "source": "https://github.com/paritytech/contracts/blob/58842b92c00e3c45a84b6d0ac9b842f016dde50a/SignatureReg.sol",
- "output": "0x606060405260008054600160a060020a03191633600160a060020a0316178155600255341561002a57fe5b5b60408051808201909152601081527f726567697374657228737472696e67290000000000000000000000000000000060208201526100759064010000000061036661007c82021704565b505b61031c565b60006100f7826040518082805190602001908083835b602083106100b15780518252601f199092019160209182019101610092565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020836100ff640100000000026103d6176401000000009004565b90505b919050565b7fffffffff000000000000000000000000000000000000000000000000000000008216600090815260016020819052604082205484916002908216156101000260001901909116041561015157610274565b7fffffffff000000000000000000000000000000000000000000000000000000008416600090815260016020908152604090912084516101939286019061027c565b5060028054600101905560408051602080825285518183015285517fffffffff00000000000000000000000000000000000000000000000000000000881693600160a060020a033316937f50e01e16719d6c699e516c57f4c514e77f6bc21a978d33f23980acdddbcbd0b293899391928392908301918501908083838215610236575b80518252602083111561023657601f199092019160209182019101610216565b505050905090810190601f1680156102625780820380516001836020036101000a031916815260200191505b509250505060405180910390a3600191505b5b5092915050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106102bd57805160ff19168380011785556102ea565b828001600101855582156102ea579182015b828111156102ea5782518255916020019190600101906102cf565b5b506102f79291506102fb565b5090565b61031991905b808211156102f75760008155600101610301565b5090565b90565b6105d78061032b6000396000f3006060604052361561005c5763ffffffff60e060020a60003504166313af4035811461005e5780633015a5211461007c5780638da5cb5b1461009e5780639890220b146100ca578063b46bcdaa146100dc578063f2c298be14610179575bfe5b341561006657fe5b61007a600160a060020a03600435166101e3565b005b341561008457fe5b61008c610264565b60408051918252519081900360200190f35b34156100a657fe5b6100ae61026a565b60408051600160a060020a039092168252519081900360200190f35b34156100d257fe5b61007a610279565b005b34156100e457fe5b6100f9600160e060020a0319600435166102cc565b60408051602080825283518183015283519192839290830191850190808383821561013f575b80518252602083111561013f57601f19909201916020918201910161011f565b505050905090810190601f16801561016b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561018157fe5b6101cf600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284375094965061036695505050505050565b604080519115158252519081900360200190f35b60005433600160a060020a039081169116146101fe57610260565b60008054604051600160a060020a03808516939216917f70aea8d848e8a90fb7661b227dc522eb6395c3dac71b63cb59edd5c9899b236491a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b60025481565b600054600160a060020a031681565b60005433600160a060020a03908116911614610294576102c8565b604051600160a060020a0333811691309091163180156108fc02916000818181858888f1935050505015156102c857610000565b5b5b565b60016020818152600092835260409283902080548451600294821615610100026000190190911693909304601f810183900483028401830190945283835291929083018282801561035e5780601f106103335761010080835404028352916020019161035e565b820191906000526020600020905b81548152906001019060200180831161034157829003601f168201915b505050505081565b60006103ce826040518082805190602001908083835b6020831061039b5780518252601f19909201916020918201910161037c565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020836103d6565b90505b919050565b600160e060020a03198216600090815260016020819052604082205484916002908216156101000260001901909116041561041057610503565b600160e060020a031984166000908152600160209081526040909120845161043a9286019061050b565b506002805460010190556040805160208082528551818301528551600160e060020a0319881693600160a060020a033316937f50e01e16719d6c699e516c57f4c514e77f6bc21a978d33f23980acdddbcbd0b2938993919283929083019185019080838382156104c5575b8051825260208311156104c557601f1990920191602091820191016104a5565b505050905090810190601f1680156104f15780820380516001836020036101000a031916815260200191505b509250505060405180910390a3600191505b5b5092915050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061054c57805160ff1916838001178555610579565b82800160010185558215610579579182015b8281111561057957825182559160200191906001019061055e565b5b5061058692915061058a565b5090565b6105a891905b808211156105865760008155600101610590565b5090565b905600a165627a7a723058206830357dde798fafa19dd78a4460c047f76cc132713db13442c5da7485fc0ff40029"
-}
diff --git a/js/packages/dapp-chaindeploy/contracts/code/tokendeploy.json b/js/packages/dapp-chaindeploy/contracts/code/tokendeploy.json
deleted file mode 100644
index 7dd0391b1..000000000
--- a/js/packages/dapp-chaindeploy/contracts/code/tokendeploy.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "compiler": "v0.4.9+commit.364da425",
- "source": "https://github.com/paritytech/contracts/blob/0ca02d60066202432305c8e9b1cbf33267478ab3/BasicCoin.sol",
- "output": "0x606060405260008054600160a060020a03191633600160a060020a0316179055341561002757fe5b5b610f43806100376000396000f3006060604052361561007d5763ffffffff60e060020a600035041663061ea8cc811461007f57806306661abd146100ad57806313af4035146100cf5780635001f3b5146100ed5780638da5cb5b1461010f5780639507d39a1461013b5780639890220b14610179578063acfdfd1c1461018b578063c00ca38314610236575bfe5b341561008757fe5b61009b600160a060020a0360043516610280565b60408051918252519081900360200190f35b34156100b557fe5b61009b61029f565b60408051918252519081900360200190f35b34156100d757fe5b6100eb600160a060020a03600435166102a6565b005b34156100f557fe5b61009b610327565b60408051918252519081900360200190f35b341561011757fe5b61011f61032e565b60408051600160a060020a039092168252519081900360200190f35b341561014357fe5b61014e60043561033d565b60408051600160a060020a039485168152928416602084015292168183015290519081900360600190f35b341561018157fe5b6100eb610392565b005b60408051602060046024803582810135601f8101859004850286018501909652858552610222958335959394604494939290920191819084018382808284375050604080516020601f89358b0180359182018390048302840183019094528083529799988101979196509182019450925082915084018382808284375094965050509235600160a060020a031692506103e5915050565b604080519115158252519081900360200190f35b341561023e57fe5b61014e600160a060020a036004351660243561079b565b60408051600160a060020a039485168152928416602084015292168183015290519081900360600190f35b600160a060020a0381166000908152600260205260409020545b919050565b6001545b90565b60005433600160a060020a039081169116146102c157610000565b60008054604051600160a060020a03808516939216917f70aea8d848e8a90fb7661b227dc522eb6395c3dac71b63cb59edd5c9899b236491a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b620f424081565b600054600160a060020a031681565b600060006000600060018581548110151561035457fe5b906000526020600020906003020160005b50805460018201546002830154600160a060020a039283169750908216955016925090505b509193909250565b60005433600160a060020a039081169116146103ad57610000565b604051600160a060020a0333811691309091163180156108fc02916000818181858888f1935050505015156103e157610000565b5b5b565b60008181808088336103f56107eb565b918252600160a060020a03166020820152604080519182900301906000f080151561041c57fe5b925061042733610280565b915083600160a060020a031663ddca3f436000604051602001526040518163ffffffff1660e060020a028152600401809050602060405180830381600087803b151561046f57fe5b60325a03f1151561047c57fe5b50506040805151600160a060020a03331660009081526002602052919091209092506001840191506104ae90826107fb565b50600154600160a060020a03331660009081526002602052604090208054849081106104d657fe5b906000526020600020900160005b5055600180548082016104f78382610825565b916000526020600020906003020160005b60606040519081016040528087600160a060020a0316815260200133600160a060020a0316815260200188600160a060020a0316815250909190915060008201518160000160006101000a815481600160a060020a030219169083600160a060020a0316021790555060208201518160010160006101000a815481600160a060020a030219169083600160a060020a0316021790555060408201518160020160006101000a815481600160a060020a030219169083600160a060020a0316021790555050505083600160a060020a0316637b1a547c82858b620f42408c336000604051602001526040518763ffffffff1660e060020a0281526004018086600160a060020a0316600160a060020a03168152602001806020018581526020018060200184600160a060020a0316600160a060020a03168152602001838103835287818151815260200191508051906020019080838360008314610686575b80518252602083111561068657601f199092019160209182019101610666565b505050905090810190601f1680156106b25780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838382156106f1575b8051825260208311156106f157601f1990920191602091820191016106d1565b505050905090810190601f16801561071d5780820380516001836020036101000a031916815260200191505b509750505050505050506020604051808303818588803b151561073c57fe5b61235a5a03f1151561074a57fe5b5050604051600160a060020a03808716935087811692503316907f454b0172f64812df0cd504c2bd7df7aab8ff328a54d946b4bd0fa7c527adf9cc90600090a4600194505b50505050949350505050565b600160a060020a03821660009081526002602052604081208054829182916107dd9190869081106107c857fe5b906000526020600020900160005b505461033d565b9250925092505b9250925092565b604051610650806108c883390190565b81548183558181151161081f5760008381526020902061081f918101908301610857565b5b505050565b81548183558181151161081f5760030281600302836000526020600020918201910161081f9190610878565b5b505050565b6102a391905b80821115610871576000815560010161085d565b5090565b90565b6102a391905b8082111561087157805473ffffffffffffffffffffffffffffffffffffffff19908116825560018201805482169055600282018054909116905560030161087e565b5090565b905600606060405260008054600160a060020a03191633600160a060020a0316179055341561002757fe5b6040516040806106508339810160405280516020909101515b600034111561004e57610000565b8180151561005b57610000565b600183905560008054600160a060020a031916600160a060020a038416908117825581526002602052604090208390555b5b505b50505b6105af806100a16000396000f3006060604052361561007d5763ffffffff60e060020a600035041663095ea7b3811461009257806313af4035146100c557806318160ddd146100e357806323b872dd146101055780635001f3b51461013e57806370a08231146101605780638da5cb5b1461018e578063a9059cbb146101ba578063dd62ed3e146101ed575b341561008557fe5b6100905b610000565b565b005b341561009a57fe5b6100b1600160a060020a0360043516602435610221565b604080519115158252519081900360200190f35b34156100cd57fe5b610090600160a060020a03600435166102b6565b005b34156100eb57fe5b6100f3610337565b60408051918252519081900360200190f35b341561010d57fe5b6100b1600160a060020a036004358116906024351660443561033d565b604080519115158252519081900360200190f35b341561014657fe5b6100f361045d565b60408051918252519081900360200190f35b341561016857fe5b6100f3600160a060020a0360043516610464565b60408051918252519081900360200190f35b341561019657fe5b61019e610483565b60408051600160a060020a039092168252519081900360200190f35b34156101c257fe5b6100b1600160a060020a0360043516602435610492565b604080519115158252519081900360200190f35b34156101f557fe5b6100f3600160a060020a0360043581169060243516610552565b60408051918252519081900360200190f35b6000600034111561023157610000565b82600160a060020a031633600160a060020a03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a350600160a060020a0333811660009081526002602090815260408083209386168352600193840190915290208054830190555b5b92915050565b60005433600160a060020a039081169116146102d157610000565b60008054604051600160a060020a03808516939216917f70aea8d848e8a90fb7661b227dc522eb6395c3dac71b63cb59edd5c9899b236491a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b60015481565b6000600034111561034d57610000565b600160a060020a038416600090815260026020526040902054849083908190101561037757610000565b600160a060020a0380871660009081526002602090815260408083203394851684526001019091529020548791908690819010156103b457610000565b87600160a060020a031689600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef896040518082815260200191505060405180910390a3600160a060020a03808a16600090815260026020818152604080842033861685526001808201845282862080548f900390559390925281548c9003909155928b16825291902080548901905595505b5b5050505b50505b9392505050565b620f424081565b600160a060020a0381166000908152600260205260409020545b919050565b600054600160a060020a031681565b600060003411156104a257610000565b33600160a060020a0381166000908152600260205260409020548390819010156104cb57610000565b84600160a060020a031633600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3600160a060020a0333811660009081526002602052604080822080548890039055918716815220805485019055600192505b5b50505b92915050565b600160a060020a03808316600090815260026020908152604080832093851683526001909301905220545b929150505600a165627a7a72305820b5bf89a0a85c15df1e9717e49be06fe1a4f9dcc1e0cebf5483dd1c0bcd14a0910029a165627a7a723058207f96b7ad40c02cfaeaf29e65c79456dd3fd9828c9d3fbaf801fb60010456c3880029"
-}
diff --git a/js/packages/dapp-chaindeploy/contracts/code/tokenreg.json b/js/packages/dapp-chaindeploy/contracts/code/tokenreg.json
deleted file mode 100644
index bcba34127..000000000
--- a/js/packages/dapp-chaindeploy/contracts/code/tokenreg.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "compiler": "v0.4.9+commit.364da425",
- "source": "https://github.com/paritytech/contracts/blob/58842b92c00e3c45a84b6d0ac9b842f016dde50a/TokenReg.sol",
- "output": "0x606060405260008054600160a060020a03191633600160a060020a0316179055670de0b6b3a7640000600455341561003357fe5b5b611473806100436000396000f300606060405236156100b45763ffffffff60e060020a600035041663044215c681146100b657806313af4035146101df57806366b42dcb146101fd57806369fe0e2d146102ab5780637958533a146102c05780637b1a547c146102e8578063891de9ed146103a15780638da5cb5b146104bc5780639890220b146104e85780639f181b5e146104fa578063a02b161e1461051c578063b72e717d14610531578063dd93890b1461066a578063ddca3f4314610685575bfe5b34156100be57fe5b6100c96004356106a7565b60408051600160a060020a038088168252918101859052908216608082015260a060208083018281528751928401929092528651606084019160c0850191908901908083838215610135575b80518252602083111561013557601f199092019160209182019101610115565b505050905090810190601f1680156101615780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838382156101a0575b8051825260208311156101a057601f199092019160209182019101610180565b505050905090810190601f1680156101cc5780820380516001836020036101000a031916815260200191505b5097505050505050505060405180910390f35b34156101e757fe5b6101fb600160a060020a036004351661083a565b005b60408051602060046024803582810135601f8101859004850286018501909652858552610297958335600160a060020a0316959394604494939290920191819084018382808284375050604080516020601f818a01358b0180359182018390048302840183018552818452989a8a359a9099940197509195509182019350915081908401838280828437509496506108ae95505050505050565b604080519115158252519081900360200190f35b34156102b357fe5b6101fb6004356108c8565b005b34156102c857fe5b6102d66004356024356108ed565b60408051918252519081900360200190f35b60408051602060046024803582810135601f8101859004850286018501909652858552610297958335600160a060020a0316959394604494939290920191819084018382808284375050604080516020601f818a01358b0180359182018390048302840183018552818452989a8a359a90999401975091955091820193509150819084018382808284375094965050509235600160a060020a0316925061092c915050565b604080519115158252519081900360200190f35b34156103a957fe5b6103f7600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843750949650610c6695505050505050565b6040518086815260200185600160a060020a0316600160a060020a031681526020018481526020018060200183600160a060020a0316600160a060020a0316815260200182810382528481815181526020019150805190602001908083836000831461047e575b80518252602083111561047e57601f19909201916020918201910161045e565b505050905090810190601f1680156104aa5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390f35b34156104c457fe5b6104cc610dca565b60408051600160a060020a039092168252519081900360200190f35b34156104f057fe5b6101fb610dd9565b005b341561050257fe5b6102d6610e2c565b60408051918252519081900360200190f35b341561052457fe5b6101fb600435610e33565b005b341561053957fe5b61054d600160a060020a0360043516611047565b60405180868152602001806020018581526020018060200184600160a060020a0316600160a060020a03168152602001838103835287818151815260200191508051906020019080838360008314610135575b80518252602083111561013557601f199092019160209182019101610115565b505050905090810190601f1680156101615780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838382156101a0575b8051825260208311156101a057601f199092019160209182019101610180565b505050905090810190601f1680156101cc5780820380516001836020036101000a031916815260200191505b5097505050505050505060405180910390f35b341561067257fe5b6101fb6004356024356044356111f3565b005b341561068d57fe5b6102d66112b0565b60408051918252519081900360200190f35b60006106b16112b6565b60006106bb6112b6565b600060006003878154811015156106ce57fe5b906000526020600020906006020160005b50805460018083018054604080516020601f600260001997861615610100029790970190941695909504928301859004850281018501909152818152600160a060020a039094169a5093945091929083018282801561077f5780601f106107545761010080835404028352916020019161077f565b820191906000526020600020905b81548152906001019060200180831161076257829003601f168201915b505050600280850154600386018054604080516020601f6000196101006001871615020190941696909604928301869004860281018601909152818152969b50919950935091508301828280156108175780601f106107ec57610100808354040283529160200191610817565b820191906000526020600020905b8154815290600101906020018083116107fa57829003601f168201915b50505050600483015491945050600160a060020a031691505b5091939590929450565b60005433600160a060020a03908116911614610855576108aa565b60008054604051600160a060020a03808516939216917f70aea8d848e8a90fb7661b227dc522eb6395c3dac71b63cb59edd5c9899b236491a360008054600160a060020a031916600160a060020a0383161790555b5b50565b60006108bd858585853361092c565b90505b949350505050565b60005433600160a060020a039081169116146108e3576108aa565b60048190555b5b50565b60006003838154811015156108fe57fe5b906000526020600020906006020160005b506000838152600591909101602052604090205490505b92915050565b600060045434101561093d57610c5d565b600160a060020a03861660009081526001602052604090205486901561096257610c5b565b8551869060031461097257610c59565b866002816040518082805190602001908083835b602083106109a55780518252601f199092019160209182019101610986565b51815160209384036101000a60001901801990921691161790529201948552506040519384900301909220541591506109df905057610c56565b60038054600181016109f183826112c8565b916000526020600020906006020160005b506040805160a081018252600160a060020a03808e1680835260208084018f90529383018d9052606083018c9052908a1660808301528354600160a060020a0319161783558b51909291610a5d9160018401918e01906112fa565b506040820151600282015560608201518051610a839160038401916020909101906112fa565b506080919091015160049091018054600160a060020a031916600160a060020a03928316179055600354908b1660009081526001602090815260409182902083905590518b519293506002928c928291908401908083835b60208310610afa5780518252601f199092019160209182019101610adb565b51815160001960209485036101000a81019182169119929092161790915293909101958652604051958690038101862096909655506003548d519101948d9493508392508401908083835b60208310610b645780518252601f199092019160209182019101610b45565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390207f25074d730da65a10e171fe5589d2182313ef00da38d23a9ae3b78923568bdf2d8b896040518083600160a060020a0316600160a060020a0316815260200180602001828103825283818151815260200191508051906020019080838360008314610c17575b805182526020831115610c1757601f199092019160209182019101610bf7565b505050905090810190601f168015610c435780820380516001836020036101000a031916815260200191505b50935050505060405180910390a3600193505b5b505b505b505b95945050505050565b600060006000610c746112b6565b6000600060016002886040518082805190602001908083835b60208310610cac5780518252601f199092019160209182019101610c8d565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902054039550600386815481101515610cf257fe5b906000526020600020906006020160005b5080546002808301546003840180546040805160206101006001851615026000190190931695909504601f8101839004830286018301909152808552600160a060020a039095169a50919850939450909291908301828280156108175780601f106107ec57610100808354040283529160200191610817565b820191906000526020600020905b8154815290600101906020018083116107fa57829003601f168201915b50505050600483015491945050600160a060020a031691505b5091939590929450565b600054600160a060020a031681565b60005433600160a060020a03908116911614610df457610e28565b604051600160a060020a0333811691309091163180156108fc02916000818181858888f193505050501515610e2857610000565b5b5b565b6003545b90565b60005433600160a060020a03908116911614610e4e576108aa565b80600382815481101515610e5e57fe5b906000526020600020906006020160005b506001016040518082805460018160011615610100020316600290048015610ece5780601f10610eac576101008083540402835291820191610ece565b820191906000526020600020905b815481529060010190602001808311610eba575b505060405190819003812092507f96e76fa77fea85d8abeb7533fdb8288c214bb1dcf1f867c8f36a95f1f509c1759150600090a360016000600383815481101515610f1557fe5b906000526020600020906006020160005b5054600160a060020a031681526020810191909152604001600090812055600380546002919083908110610f5657fe5b906000526020600020906006020160005b506001016040518082805460018160011615610100020316600290048015610fc65780601f10610fa4576101008083540402835291820191610fc6565b820191906000526020600020905b815481529060010190602001808311610fb2575b50509283525050604051908190036020019020600090556003805482908110610feb57fe5b906000526020600020906006020160005b8154600160a060020a0319168255611018600183016000611379565b60028201600090556003820160006110309190611379565b506004018054600160a060020a03191690555b5b50565b60006110516112b6565b600061105b6112b6565b600160a060020a03851660009081526001602052604081205460038054600019909201965082918790811061108c57fe5b906000526020600020906006020160005b509050806001018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561077f5780601f106107545761010080835404028352916020019161077f565b820191906000526020600020905b81548152906001019060200180831161076257829003601f168201915b505050600280850154600386018054604080516020601f6000196101006001871615020190941696909604928301869004860281018601909152818152969b50919950935091508301828280156108175780601f106107ec57610100808354040283529160200191610817565b820191906000526020600020905b8154815290600101906020018083116107fa57829003601f168201915b50505050600483015491945050600160a060020a031691505b5091939590929450565b8233600160a060020a031660038281548110151561120d57fe5b906000526020600020906006020160005b5060040154600160a060020a031614611236576112a9565b8160038581548110151561124657fe5b906000526020600020906006020160005b50600085815260059190910160209081526040918290209290925580518481529051859287927f7991c63a749706fd298fc2387764d640be6e714307b6357b1d3c2ce35cba3b52929081900390910190a35b5b50505050565b60045481565b60408051602081019091526000815290565b8154818355818115116112f4576006028160060283600052602060002091820191016112f491906113c1565b5b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061133b57805160ff1916838001178555611368565b82800160010185558215611368579182015b8281111561136857825182559160200191906001019061134d565b5b50611375929150611426565b5090565b50805460018160011615610100020316600290046000825580601f1061139f57506108aa565b601f0160209004906000526020600020908101906108aa9190611426565b5b50565b610e3091905b80821115611375578054600160a060020a031916815560006113ec6001830182611379565b60028201600090556003820160006114049190611379565b50600481018054600160a060020a03191690556006016113c7565b5090565b90565b610e3091905b80821115611375576000815560010161142c565b5090565b905600a165627a7a72305820ab1d1a18270ba278cc2f74cd1b7b547cdcd6308a9df1dec1120fa9f6199b1f480029"
-}
diff --git a/js/packages/dapp-chaindeploy/contracts/code/verifyEmail.json b/js/packages/dapp-chaindeploy/contracts/code/verifyEmail.json
deleted file mode 100644
index a87fb0a22..000000000
--- a/js/packages/dapp-chaindeploy/contracts/code/verifyEmail.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "compiler": "v0.4.9+commit.364da425",
- "source": "https://github.com/paritytech/contracts/blob/e5afdacc716ca743ceddf80978d4e6b2b465dbe9/ProofOfEmail.sol",
- "output": "0x606060405260008054600160a060020a03191633600160a060020a0316178155600355341561002a57fe5b5b6108a48061003a6000396000f300606060405236156100ca5763ffffffff60e060020a60003504166306b2ff4781146100cc57806313af4035146100fc5780632650b9881461011a5780634b59e8801461018c57806359c87d70146101b05780636795dbcd146101bd57806369fe0e2d1461023057806370c4d5f214610245578063797af627146103255780638da5cb5b1461034c5780639890220b14610378578063ac72c1201461038a578063cc1d4c02146103b1578063ddca3f43146103e1578063df57b74214610403578063e30bd74014610432575bfe5b34156100d457fe5b6100e8600160a060020a03600435166104ce565b604080519115158252519081900360200190f35b341561010457fe5b610118600160a060020a03600435166104d6565b005b341561012257fe5b60408051602060046024803582810135601f810185900485028601850190965285855261017a958335600160a060020a0316959394604494939290920191819084018382808284375094965061055795505050505050565b60408051918252519081900360200190f35b341561019457fe5b610118600160a060020a0360043516602435604435610577565b005b6101186004356105eb565b005b34156101c557fe5b60408051602060046024803582810135601f8101859004850286018501909652858552610214958335959394604494939290920191819084018382808284375094965061063595505050505050565b60408051600160a060020a039092168252519081900360200190f35b341561023857fe5b610118600435610654565b005b341561024d57fe5b60408051602060046024803582810135601f81018590048502860185019096528585526102a5958335600160a060020a0316959394604494939290920191819084018382808284375094965061067995505050505050565b6040805160208082528351818301528351919283929083019185019080838382156102eb575b8051825260208311156102eb57601f1990920191602091820191016102cb565b505050905090810190601f1680156103175780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561032d57fe5b6100e8600435610688565b604080519115158252519081900360200190f35b341561035457fe5b610214610791565b60408051600160a060020a039092168252519081900360200190f35b341561038057fe5b6101186107a0565b005b341561039257fe5b6100e86004356107f3565b604080519115158252519081900360200190f35b34156103b957fe5b6100e8600160a060020a0360043516610813565b604080519115158252519081900360200190f35b34156103e957fe5b61017a610834565b60408051918252519081900360200190f35b341561040b57fe5b61021460043561083a565b60408051600160a060020a039092168252519081900360200190f35b341561043a57fe5b6102a5600160a060020a0360043516610858565b6040805160208082528351818301528351919283929083019185019080838382156102eb575b8051825260208311156102eb57601f1990920191602091820191016102cb565b505050905090810190601f1680156103175780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b60005b919050565b60005433600160a060020a039081169116146104f157610553565b60008054604051600160a060020a03808516939216917f70aea8d848e8a90fb7661b227dc522eb6395c3dac71b63cb59edd5c9899b236491a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b600160a060020a0382166000908152600260205260409020545b92915050565b60005433600160a060020a03908116911614610592576105e5565b600082815260046020908152604091829020839055815184815291518392600160a060020a038716927f76babef7e9f1065118be3f9d7094016a1cc06dd12811501c7712deb22144f37b92918290030190a35b5b505050565b6003543410156105fa57610553565b6040518190600160a060020a033316907f070669e6be82aa9b077a096b0f9617893a4dc5cb05897e27fd7a6112c8e6629e90600090a35b5b50565b600082815260016020526040902054600160a060020a03165b92915050565b60005433600160a060020a0390811691161461066f57610553565b60038190555b5b50565b610571610866565b5b92915050565b6040805182815281516020918190038201902060009081526004909152908120548015156106b55761078b565b6040805184815281516020918190038201902060009081526004825282812081905583815260019091522054600160a060020a031615158061070e5750600160a060020a03331660009081526002602052604090205415155b156107185761078b565b6000818152600160209081526040808320805473ffffffffffffffffffffffffffffffffffffffff191633600160a060020a031690811790915580845260029092528083208490555190917fd415b905d4dd806bfba99a7a0e6351bd0c9db3a9912add21c0e6bef4479f673f91a2600191505b50919050565b600054600160a060020a031681565b60005433600160a060020a039081169116146107bb576107ef565b604051600160a060020a0333811691309091163180156108fc02916000818181858888f1935050505015156107ef57610000565b5b5b565b600081815260016020526040902054600160a060020a031615155b919050565b600160a060020a03811660009081526002602052604090205415155b919050565b60035481565b600081815260016020526040902054600160a060020a03165b919050565b6104d1610866565b5b919050565b604080516020810190915260008152905600a165627a7a7230582081d03388dd06c78ee4098c4f1e23cd3c25e38d249d5da59962c6b28ec6e20ea70029"
-}
diff --git a/js/packages/dapp-chaindeploy/contracts/code/verifySms.json b/js/packages/dapp-chaindeploy/contracts/code/verifySms.json
deleted file mode 100644
index 0cfc43f9d..000000000
--- a/js/packages/dapp-chaindeploy/contracts/code/verifySms.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "compiler": "v0.4.9+commit.364da425",
- "source": "https://github.com/paritytech/contracts/blob/58842b92c00e3c45a84b6d0ac9b842f016dde50a/SMSVerification.sol",
- "output": "0x606060405260008054600160a060020a033316600160a060020a03199182168117909255600280549091169091179055666a94d74f430000600455341561004257fe5b5b6109a0806100526000396000f300606060405236156100ca5763ffffffff60e060020a60003504166313af403581146100cc57806314253887146100ea578063338cdca1146101085780633da5c3ce146101125780635283f3391461013357806369fe0e2d146101af57806374a8f103146101c4578063797af627146101e25780638da5cb5b146102095780639890220b14610235578063c89e436114610247578063ca4cbf6714610273578063ca5eb5e1146102e5578063cc1d4c0214610303578063ddca3f4314610333578063fc2525ab14610273575bfe5b34156100d457fe5b6100e8600160a060020a03600435166103c7565b005b34156100f257fe5b6100e8600160a060020a0360043516610448565b005b6100e86104b4565b005b341561011a57fe5b6100e8600160a060020a0360043516602435610521565b005b341561013b57fe5b60408051602060046024803582810135601f8101859004850286018501909652858552610193958335600160a060020a0316959394604494939290920191819084018382808284375094965061059295505050505050565b60408051600160a060020a039092168252519081900360200190f35b34156101b757fe5b6100e8600435610623565b005b34156101cc57fe5b6100e8600160a060020a0360043516610648565b005b34156101ea57fe5b6101f56004356106d9565b604080519115158252519081900360200190f35b341561021157fe5b610193610771565b60408051600160a060020a039092168252519081900360200190f35b341561023d57fe5b6100e8610780565b005b341561024f57fe5b6101936107d3565b60408051600160a060020a039092168252519081900360200190f35b341561027b57fe5b60408051602060046024803582810135601f81018590048502860185019096528585526102d3958335600160a060020a0316959394604494939290920191819084018382808284375094965061059295505050505050565b60408051918252519081900360200190f35b34156102ed57fe5b6100e8600160a060020a0360043516610873565b005b341561030b57fe5b6101f5600160a060020a03600435166108bb565b604080519115158252519081900360200190f35b341561033b57fe5b6102d36108dd565b60408051918252519081900360200190f35b341561027b57fe5b60408051602060046024803582810135601f81018590048502860185019096528585526102d3958335600160a060020a0316959394604494939290920191819084018382808284375094965061059295505050505050565b60408051918252519081900360200190f35b60005433600160a060020a039081169116146103e257610444565b60008054604051600160a060020a03808516939216917f70aea8d848e8a90fb7661b227dc522eb6395c3dac71b63cb59edd5c9899b236491a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b60025433600160a060020a0390811691161461046357610444565b600160a060020a0381166000818152600160208190526040808320805460ff1916909217909155517fd415b905d4dd806bfba99a7a0e6351bd0c9db3a9912add21c0e6bef4479f673f9190a25b5b50565b6004543410156104c35761051e565b600160a060020a03331660009081526001602052604090205460ff16156104e95761051e565b604051600160a060020a033316907f039f711c9c18dd815b225b1424855e6118e746c6b5d688907f10c4dd29ebe92a90600090a25b5b565b60025433600160a060020a0390811691161461053c5761058d565b600160a060020a038216600081815260036020908152604091829020849055815184815291517fa9a343b39eac85ffb326e93ecd46785b814e72dc9f2b33bb0b4a315ba2859f439281900390910190a25b5b5050565b60006001600084600160a060020a0316600160a060020a03168152602001908152602001600020600101826040518082805190602001908083835b602083106105ec5780518252601f1990920191602091820191016105cd565b51815160209384036101000a6000190180199092169116179052920194855250604051938490030190922054925050505b92915050565b60005433600160a060020a0390811691161461063e57610444565b60048190555b5b50565b60025433600160a060020a0390811691161461066357610444565b600160a060020a038116600090815260016020526040902054819060ff16151561068c5761058d565b600160a060020a038216600081815260016020526040808220805460ff19169055517fb6fa8b8bd5eab60f292eca876e3ef90722275b785309d84b1de113ce0b8c4e749190a25b5b505b50565b6040805182815281516020918190038201902033600160a060020a031660009081526003909252918120549091146107105761076c565b600160a060020a0333166000818152600360209081526040808320839055600191829052808320805460ff1916909217909155517fd415b905d4dd806bfba99a7a0e6351bd0c9db3a9912add21c0e6bef4479f673f9190a25060015b919050565b600054600160a060020a031681565b60005433600160a060020a0390811691161461079b5761051e565b604051600160a060020a0333811691309091163180156108fc02916000818181858888f19350505050151561051e57610000565b5b5b565b600254600160a060020a031681565b60006001600084600160a060020a0316600160a060020a03168152602001908152602001600020600101826040518082805190602001908083835b602083106105ec5780518252601f1990920191602091820191016105cd565b51815160209384036101000a6000190180199092169116179052920194855250604051938490030190922054925050505b92915050565b60005433600160a060020a0390811691161461088e57610444565b6002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b600160a060020a03811660009081526001602052604090205460ff165b919050565b60045481565b60006001600084600160a060020a0316600160a060020a03168152602001908152602001600020600101826040518082805190602001908083835b602083106105ec5780518252601f1990920191602091820191016105cd565b51815160209384036101000a6000190180199092169116179052920194855250604051938490030190922054925050505b929150505600a165627a7a72305820f6beb9c0ae3b45609ad6fc26c1b74600cbaa5f0088ca07be3e9c392a12b2c6150029"
-}
diff --git a/js/packages/dapp-chaindeploy/contracts/dappreg.js b/js/packages/dapp-chaindeploy/contracts/dappreg.js
deleted file mode 100644
index 7fd705455..000000000
--- a/js/packages/dapp-chaindeploy/contracts/dappreg.js
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import abi from '@parity/shared/contracts/abi/dappreg';
-
-import { compiler, source as sourceUrl, output as byteCode } from './code/dappreg';
-
-const id = 'dappreg'; // 7bbc4f1a27628781b96213e781a1b8eec6982c1db8fac739af6e4c5a55862c03
-const deployParams = [];
-
-export {
- abi,
- byteCode,
- compiler,
- deployParams,
- id,
- sourceUrl
-};
diff --git a/js/packages/dapp-chaindeploy/contracts/gavcoin.js b/js/packages/dapp-chaindeploy/contracts/gavcoin.js
deleted file mode 100644
index ffbfe6e28..000000000
--- a/js/packages/dapp-chaindeploy/contracts/gavcoin.js
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import abi from '@parity/shared/contracts/abi/gavcoin';
-
-import { compiler, source as sourceUrl, output as byteCode } from './code/gavcoin';
-
-const isExternal = true;
-const id = 'gavcoin';
-const deployParams = [];
-
-export {
- abi,
- byteCode,
- compiler,
- deployParams,
- id,
- isExternal,
- sourceUrl
-};
diff --git a/js/packages/dapp-chaindeploy/contracts/githubhint.js b/js/packages/dapp-chaindeploy/contracts/githubhint.js
deleted file mode 100644
index 1c40834a5..000000000
--- a/js/packages/dapp-chaindeploy/contracts/githubhint.js
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import abi from '@parity/shared/contracts/abi/githubhint';
-
-import { compiler, source as sourceUrl, output as byteCode } from './code/githubhint';
-
-const id = 'githubhint';
-const deployParams = [];
-
-export {
- abi,
- byteCode,
- compiler,
- deployParams,
- id,
- sourceUrl
-};
diff --git a/js/packages/dapp-chaindeploy/contracts/index.js b/js/packages/dapp-chaindeploy/contracts/index.js
deleted file mode 100644
index 5e066f758..000000000
--- a/js/packages/dapp-chaindeploy/contracts/index.js
+++ /dev/null
@@ -1,52 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import * as badgereg from './badgereg';
-import * as dappreg from './dappreg';
-import * as gavcoin from './gavcoin';
-import * as githubhint from './githubhint';
-import * as jgvoting from './jg-voting';
-import * as registry from './registry';
-import * as signaturereg from './signaturereg';
-import * as tokendeployMgr from './tokendeployMgr';
-import * as tokendeployReg from './tokendeployReg';
-import * as tokenreg from './tokenreg';
-import * as verifyEmail from './verifyEmail';
-import * as verifySms from './verifySms';
-import * as wallet from './wallet';
-
-const contracts = [
- // builtin
- githubhint,
- badgereg,
- dappreg,
- signaturereg,
- tokenreg,
- tokendeployReg,
- tokendeployMgr,
- verifyEmail,
- verifySms,
- wallet,
-
- // external
- gavcoin,
- jgvoting
-];
-
-export {
- contracts,
- registry
-};
diff --git a/js/packages/dapp-chaindeploy/contracts/jg-voting.js b/js/packages/dapp-chaindeploy/contracts/jg-voting.js
deleted file mode 100644
index 8ffbed3c5..000000000
--- a/js/packages/dapp-chaindeploy/contracts/jg-voting.js
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import abi from './abi/jg-voting';
-import { compiler, source as sourceUrl, output as byteCode } from './code/jg-voting';
-
-const isExternal = true;
-const id = 'jg-voting';
-const deployParams = [];
-
-export {
- abi,
- byteCode,
- compiler,
- deployParams,
- id,
- isExternal,
- sourceUrl
-};
diff --git a/js/packages/dapp-chaindeploy/contracts/registry.js b/js/packages/dapp-chaindeploy/contracts/registry.js
deleted file mode 100644
index 4c2ea2ec0..000000000
--- a/js/packages/dapp-chaindeploy/contracts/registry.js
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import abi from '@parity/shared/contracts/abi/registry2';
-
-import { compiler, source as sourceUrl, output as byteCode } from './code/registry';
-
-const id = 'registry';
-const deployParams = [];
-
-export {
- abi,
- byteCode,
- compiler,
- deployParams,
- id,
- sourceUrl
-};
diff --git a/js/packages/dapp-chaindeploy/contracts/signaturereg.js b/js/packages/dapp-chaindeploy/contracts/signaturereg.js
deleted file mode 100644
index cd35e14e8..000000000
--- a/js/packages/dapp-chaindeploy/contracts/signaturereg.js
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import abi from '@parity/shared/contracts/abi/signaturereg';
-
-import { compiler, source as sourceUrl, output as byteCode } from './code/signaturereg';
-
-const id = 'signaturereg';
-const deployParams = [];
-
-export {
- abi,
- byteCode,
- compiler,
- deployParams,
- id,
- sourceUrl
-};
diff --git a/js/packages/dapp-chaindeploy/contracts/tokendeployMgr.js b/js/packages/dapp-chaindeploy/contracts/tokendeployMgr.js
deleted file mode 100644
index 489614b6c..000000000
--- a/js/packages/dapp-chaindeploy/contracts/tokendeployMgr.js
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import abi from '@parity/shared/contracts/abi/basiccoinmanager';
-
-import { compiler, source as sourceUrl, output as byteCode } from './code/tokendeploy';
-
-const id = 'basiccoinmgr';
-const deployParams = [];
-
-export {
- abi,
- byteCode,
- compiler,
- deployParams,
- id,
- sourceUrl
-};
diff --git a/js/packages/dapp-chaindeploy/contracts/tokendeployReg.js b/js/packages/dapp-chaindeploy/contracts/tokendeployReg.js
deleted file mode 100644
index 1db07e91a..000000000
--- a/js/packages/dapp-chaindeploy/contracts/tokendeployReg.js
+++ /dev/null
@@ -1,28 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { abi, sourceUrl, deployParams, compiler, byteCode } from './tokenreg';
-
-const id = 'basiccoinreg';
-
-export {
- abi,
- byteCode,
- compiler,
- deployParams,
- id,
- sourceUrl
-};
diff --git a/js/packages/dapp-chaindeploy/contracts/tokenreg.js b/js/packages/dapp-chaindeploy/contracts/tokenreg.js
deleted file mode 100644
index 946977436..000000000
--- a/js/packages/dapp-chaindeploy/contracts/tokenreg.js
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import abi from '@parity/shared/contracts/abi/tokenreg';
-
-import { compiler, source as sourceUrl, output as byteCode } from './code/tokenreg';
-
-const id = 'tokenreg';
-const deployParams = [];
-
-export {
- abi,
- byteCode,
- compiler,
- deployParams,
- id,
- sourceUrl
-};
diff --git a/js/packages/dapp-chaindeploy/contracts/verifyEmail.js b/js/packages/dapp-chaindeploy/contracts/verifyEmail.js
deleted file mode 100644
index 300e58e4a..000000000
--- a/js/packages/dapp-chaindeploy/contracts/verifyEmail.js
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import abi from '@parity/shared/contracts/abi/email-verification';
-
-import { compiler, source as sourceUrl, output as byteCode } from './code/verifyEmail';
-
-const isBadge = true;
-const id = 'emailverification';
-const deployParams = [];
-const badgeSource = {
- imageUrl: 'https://raw.githubusercontent.com/paritytech/dapp-assets/c4721a87cb95375da91f8699438d8d7907b3f5e9/certifications/email-verification.svg',
- imageHash: '0x5617a14da2a0c210939da6eafb734e60906f64a504c3e107812668860a752dc6'
-};
-
-export {
- abi,
- badgeSource,
- byteCode,
- compiler,
- deployParams,
- id,
- isBadge,
- sourceUrl
-};
diff --git a/js/packages/dapp-chaindeploy/contracts/verifySms.js b/js/packages/dapp-chaindeploy/contracts/verifySms.js
deleted file mode 100644
index 51eb248af..000000000
--- a/js/packages/dapp-chaindeploy/contracts/verifySms.js
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import abi from '@parity/shared/contracts/abi/sms-verification';
-
-import { compiler, source as sourceUrl, output as byteCode } from './code/verifySms';
-
-const isBadge = true;
-const id = 'smsverification';
-const deployParams = [];
-const badgeSource = {
- imageUrl: 'https://raw.githubusercontent.com/paritytech/dapp-assets/1b1beb57ab1f4d3a93a12711b233b5cded791a2f/certifications/sms-verification.svg',
- imageHash: '0x49fa653c35c0a9ce128579883babd673ad4cfc94bf9f1cfe96a2bbc30a7552c6'
-};
-
-export {
- abi,
- badgeSource,
- byteCode,
- compiler,
- deployParams,
- id,
- isBadge,
- sourceUrl
-};
diff --git a/js/packages/dapp-chaindeploy/contracts/wallet.js b/js/packages/dapp-chaindeploy/contracts/wallet.js
deleted file mode 100644
index e4b11059f..000000000
--- a/js/packages/dapp-chaindeploy/contracts/wallet.js
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { walletCompiler as compiler, walletLibrary as byteCode, walletLibraryABI as abiJson, walletLibraryRegKey as id, walletSource as sourceUrl } from '@parity/shared/contracts/code/wallet';
-
-const abi = JSON.parse(abiJson);
-const deployParams = [];
-
-export {
- abi,
- byteCode,
- compiler,
- deployParams,
- id,
- sourceUrl
-};
diff --git a/js/packages/dapp-chaindeploy/dapps/console.js b/js/packages/dapp-chaindeploy/dapps/console.js
deleted file mode 100644
index dc87e1bc4..000000000
--- a/js/packages/dapp-chaindeploy/dapps/console.js
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import builtins from '@parity/shared/config/dappsBuiltin.json';
-
-const id = 'console';
-const app = builtins.find((app) => app.url === id);
-const hashId = app.id;
-const source = {
- imageUrl: 'https://raw.githubusercontent.com/paritytech/console/3ea0dbfefded359ccdbea37bc4cf350c0aa16948/console.jpeg',
- imageHash: '0xc3962e2eab7afaeb9cd11522381723afbafdc41dc7ba31bee472e187c4459e81'
-};
-const name = app.name;
-
-export {
- hashId,
- id,
- name,
- source
-};
diff --git a/js/packages/dapp-chaindeploy/dapps/dappreg.js b/js/packages/dapp-chaindeploy/dapps/dappreg.js
deleted file mode 100644
index fbf2589d7..000000000
--- a/js/packages/dapp-chaindeploy/dapps/dappreg.js
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import builtins from '@parity/shared/config/dappsBuiltin.json';
-
-const id = 'dappreg';
-const app = builtins.find((app) => app.url === id);
-const hashId = app.id;
-const source = {
- imageUrl: 'https://raw.githubusercontent.com/paritytech/dapp-assets/cdd6ac4f1e2f11619bed72a53ae71217dffe19ad/dapps/legos-64x64.png',
- imageHash: '0xa8feea35c761cc6c2fe862fe336419f11ca5421f578757720a899b89fc1df154'
-};
-const name = app.name;
-
-export {
- hashId,
- id,
- name,
- source
-};
diff --git a/js/packages/dapp-chaindeploy/dapps/gavcoin.js b/js/packages/dapp-chaindeploy/dapps/gavcoin.js
deleted file mode 100644
index 148c6fb8e..000000000
--- a/js/packages/dapp-chaindeploy/dapps/gavcoin.js
+++ /dev/null
@@ -1,41 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { api } from '../parity';
-
-const isExternal = true;
-const id = 'gavcoin';
-const hashId = api.util.sha3(id);
-const source = {
- imageUrl: 'https://raw.githubusercontent.com/paritytech/dapp-assets/9e135f76fe9ba61e2d8ccbd72ed144c26c450780/tokens/gavcoin-64x64.png',
- imageHash: '0xd40679a3a234d8421c678d64f4df3308859e8ad07ac95ce4a228aceb96955287',
- manifestUrl: 'https://raw.githubusercontent.com/gavofyork/gavcoin/eb2f8dc4d3ad4dd5f4562690525b7cfedc9681ba/manifest.json',
- manifestHash: '0xd582c572fbef8015837f2c1a8798f2c3149a1d9d655b4020edb1bbece725371d',
- contentUrl: {
- repo: 'gavofyork/gavcoin',
- commit: '0xeb2f8dc4d3ad4dd5f4562690525b7cfedc9681ba'
- },
- contentHash: '0x0b6c7b3fc8dad3edb39fd1465904ce9a11938ef18f08f8115f275047ba249530'
-};
-const name = 'GavCoin';
-
-export {
- hashId,
- id,
- isExternal,
- name,
- source
-};
diff --git a/js/packages/dapp-chaindeploy/dapps/githubhint.js b/js/packages/dapp-chaindeploy/dapps/githubhint.js
deleted file mode 100644
index 7fc16489a..000000000
--- a/js/packages/dapp-chaindeploy/dapps/githubhint.js
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import builtins from '@parity/shared/config/dappsBuiltin.json';
-
-const id = 'githubhint';
-const app = builtins.find((app) => app.url === id);
-const hashId = app.id;
-const source = {
- imageUrl: 'https://raw.githubusercontent.com/paritytech/dapp-assets/b88e983abaa1a6a6345b8d9448c15b117ddb540e/dapps/link-64x64.jpg',
- imageHash: '0x6568901e711886e2c61eef1bbc7e2d8d37a27b9eb3e9e270eda8548f2ec796e8'
-};
-const name = app.name;
-
-export {
- hashId,
- id,
- name,
- source
-};
diff --git a/js/packages/dapp-chaindeploy/dapps/index.js b/js/packages/dapp-chaindeploy/dapps/index.js
deleted file mode 100644
index e95bf5648..000000000
--- a/js/packages/dapp-chaindeploy/dapps/index.js
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import * as consolejs from './console';
-import * as dappreg from './dappreg';
-import * as gavcoin from './gavcoin';
-import * as githubhint from './githubhint';
-import * as jgvoting from './jg-voting';
-import * as jgwhenblock from './jg-whenblock';
-import * as localtx from './localtx';
-import * as registry from './registry';
-import * as signaturereg from './signaturereg';
-import * as tokendeploy from './tokendeploy';
-import * as tokenreg from './tokenreg';
-import * as web from './web';
-
-const apps = [
- // builtin
- consolejs,
- dappreg,
- githubhint,
- localtx,
- registry,
- signaturereg,
- tokendeploy,
- tokenreg,
- web,
-
- // external
- gavcoin,
- jgvoting,
- jgwhenblock
-];
-
-export {
- apps
-};
diff --git a/js/packages/dapp-chaindeploy/dapps/jg-voting.js b/js/packages/dapp-chaindeploy/dapps/jg-voting.js
deleted file mode 100644
index 899e95894..000000000
--- a/js/packages/dapp-chaindeploy/dapps/jg-voting.js
+++ /dev/null
@@ -1,41 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { api } from '../parity';
-
-const isExternal = true;
-const id = 'jg-voting';
-const hashId = api.util.sha3(id);
-const source = {
- imageUrl: 'https://raw.githubusercontent.com/jacogr/dapp-voting/038ff4074544f2babc7aed9c4ac3dc070b85b804/assets/images/vote.jpg',
- imageHash: '0x3620828e1a745d2714e9f37dc2d47cdab5ef9982190a845b5e7665b7a7767661',
- manifestUrl: 'https://raw.githubusercontent.com/jacogr/dapp-voting/682f0fe4b86508a1a2487de6c7c61f7b100ba5b2/manifest.json',
- manifestHash: '0x9b83e01f87d225e7bfdd305c51319504ff9b4cf8d517ca4b64f606762e72f59e',
- contentUrl: {
- repo: 'jacogr/dapp-voting',
- commit: '0x7d941597e862a600a60b9d6ecd3a6f606d96cd7b'
- },
- contentHash: '0x9fcc0910f6a8c4e45715d41aea2d287da31bf1d7321003fc66df6a012ce2d753'
-};
-const name = 'Yes, No, Maybe';
-
-export {
- hashId,
- id,
- isExternal,
- name,
- source
-};
diff --git a/js/packages/dapp-chaindeploy/dapps/jg-whenblock.js b/js/packages/dapp-chaindeploy/dapps/jg-whenblock.js
deleted file mode 100644
index 0005ca454..000000000
--- a/js/packages/dapp-chaindeploy/dapps/jg-whenblock.js
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-const isExternal = true;
-const id = 'whenarewethere';
-const hashId = '0xfef3bfded03695e38a9ff476a0999e1fa421e72d1fb3b55a87d6c2bdb6fc18ef';
-const source = {
- imageUrl: 'https://raw.githubusercontent.com/jacogr/dapp-when-are-we-there/167aa4d904c5aa6246d0d6d6f41c4ed8a56889cd/assets/images/clock.jpg',
- imageHash: '0x2534b44f685b6399bf63f86679128216c43e9a58be1dfb58533923f0bcffeba7',
- manifestUrl: 'https://raw.githubusercontent.com/jacogr/dapp-when-are-we-there/bf72dc3033711a3ab41bec3c1249638f70bae768/manifest.json',
- manifestHash: '0xfe26f6a19ea9393d69bc5d8c73c5072ccf126f51c10c135b42d6bf162d774fd9',
- contentUrl: {
- repo: 'jacogr/dapp-when-are-we-there',
- commit: '0xbf72dc3033711a3ab41bec3c1249638f70bae768'
- },
- contentHash: '0x3505cbbef5c2243eedba07d340d4abccfaa3cfb799f51827e33c9721a5254d13'
-};
-const name = 'When are we there';
-
-export {
- hashId,
- id,
- isExternal,
- name,
- source
-};
diff --git a/js/packages/dapp-chaindeploy/dapps/localtx.js b/js/packages/dapp-chaindeploy/dapps/localtx.js
deleted file mode 100644
index 8f3d9330b..000000000
--- a/js/packages/dapp-chaindeploy/dapps/localtx.js
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import builtins from '@parity/shared/config/dappsBuiltin.json';
-
-const id = 'localtx';
-const app = builtins.find((app) => app.url === id);
-const hashId = app.id;
-const source = {
- imageUrl: 'https://raw.githubusercontent.com/paritytech/dapp-assets/cdd6ac4f1e2f11619bed72a53ae71217dffe19ad/dapps/stack-64x64.png',
- imageHash: '0x22b924801e1971659a51956dcdfc5a2d592d8bdd03780dd72d5bc4c84b595b4c'
-};
-const name = app.name;
-
-export {
- hashId,
- id,
- name,
- source
-};
diff --git a/js/packages/dapp-chaindeploy/dapps/registry.js b/js/packages/dapp-chaindeploy/dapps/registry.js
deleted file mode 100644
index d5527aa59..000000000
--- a/js/packages/dapp-chaindeploy/dapps/registry.js
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import builtins from '@parity/shared/config/dappsBuiltin.json';
-
-const id = 'registry';
-const app = builtins.find((app) => app.url === id);
-const hashId = app.id;
-const source = {
- imageUrl: 'https://raw.githubusercontent.com/paritytech/dapp-assets/b88e983abaa1a6a6345b8d9448c15b117ddb540e/dapps/register-64x64.jpg',
- imageHash: '0xf7100024052cd78b5e043287c05392b5db0bfce5caedd6d39555d40283ef0a1c'
-};
-const name = app.name;
-
-export {
- hashId,
- id,
- name,
- source
-};
diff --git a/js/packages/dapp-chaindeploy/dapps/signaturereg.js b/js/packages/dapp-chaindeploy/dapps/signaturereg.js
deleted file mode 100644
index c1e1f1063..000000000
--- a/js/packages/dapp-chaindeploy/dapps/signaturereg.js
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import builtins from '@parity/shared/config/dappsBuiltin.json';
-
-const id = 'signaturereg';
-const app = builtins.find((app) => app.url === id);
-const hashId = app.id;
-const source = {
- imageUrl: 'https://raw.githubusercontent.com/paritytech/dapp-assets/b88e983abaa1a6a6345b8d9448c15b117ddb540e/dapps/hex-64x64.jpg',
- imageHash: '0x26f7f2415cd5cbbffa58e8119fdbdd7181cac79119dd7f6ba6ee99d7f4445640'
-};
-const name = app.name;
-
-export {
- hashId,
- id,
- name,
- source
-};
diff --git a/js/packages/dapp-chaindeploy/dapps/tokendeploy.js b/js/packages/dapp-chaindeploy/dapps/tokendeploy.js
deleted file mode 100644
index 202e9578f..000000000
--- a/js/packages/dapp-chaindeploy/dapps/tokendeploy.js
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import builtins from '@parity/shared/config/dappsBuiltin.json';
-
-const id = 'tokendeploy';
-const app = builtins.find((app) => app.url === id);
-const hashId = app.id;
-const source = {
- imageUrl: 'https://raw.githubusercontent.com/paritytech/dapp-assets/b88e983abaa1a6a6345b8d9448c15b117ddb540e/dapps/interlock-64x64.png',
- imageHash: '0xde104baf02aec783e0bffc624514ee267dbcb455382375e3ffa715790c1c939f'
-};
-const name = app.name;
-
-export {
- hashId,
- id,
- name,
- source
-};
diff --git a/js/packages/dapp-chaindeploy/dapps/tokenreg.js b/js/packages/dapp-chaindeploy/dapps/tokenreg.js
deleted file mode 100644
index f7dcfd26e..000000000
--- a/js/packages/dapp-chaindeploy/dapps/tokenreg.js
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import builtins from '@parity/shared/config/dappsBuiltin.json';
-
-const id = 'tokenreg';
-const app = builtins.find((app) => app.url === id);
-const hashId = app.id;
-const source = {
- imageUrl: 'https://raw.githubusercontent.com/paritytech/dapp-assets/b88e983abaa1a6a6345b8d9448c15b117ddb540e/dapps/coins-64x64.jpg',
- imageHash: '0xe23d429d15de98c7878d92bc90b79c7afabe1b04c2ad5e3e2c89adc8f439edc9'
-};
-const name = app.name;
-
-export {
- hashId,
- id,
- name,
- source
-};
diff --git a/js/packages/dapp-chaindeploy/dapps/web.js b/js/packages/dapp-chaindeploy/dapps/web.js
deleted file mode 100644
index ed3cf0623..000000000
--- a/js/packages/dapp-chaindeploy/dapps/web.js
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import builtins from '@parity/shared/config/dappsBuiltin.json';
-
-const id = 'web';
-const app = builtins.find((app) => app.url === id);
-const hashId = app.id;
-const source = {
- imageUrl: 'https://raw.githubusercontent.com/paritytech/dapp-assets/ec6138115d0e1f45258969cd90b3b274e0ff2258/dapps/earth-64x64.jpg',
- imageHash: '0x0b9b62a9262f75461191d4e8bf686c56528cbc0fe885c1f5878052ca8b2f65bf'
-};
-const name = app.name;
-
-export {
- hashId,
- id,
- name,
- source
-};
diff --git a/js/packages/dapp-chaindeploy/index.js b/js/packages/dapp-chaindeploy/index.js
deleted file mode 100644
index c2e9db831..000000000
--- a/js/packages/dapp-chaindeploy/index.js
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import ReactDOM from 'react-dom';
-import React from 'react';
-
-import Application from './Application';
-
-import '@parity/shared/assets/fonts/Roboto/font.css';
-import '@parity/shared/assets/fonts/RobotoMono/font.css';
-import '@parity/dapps/style.css';
-
-ReactDOM.render(
- ,
- document.querySelector('#container')
-);
diff --git a/js/packages/dapp-chaindeploy/package.json b/js/packages/dapp-chaindeploy/package.json
deleted file mode 100644
index 223ce5939..000000000
--- a/js/packages/dapp-chaindeploy/package.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "name": "@parity/dapp-chaindeploy",
- "description": "Parity chain deployment",
- "version": "1.99.99",
- "main": "index.js",
- "author": "Parity Team ",
- "maintainers": [],
- "contributors": [],
- "license": "GPL-3.0",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/paritytech/dapp-chaindeploy.git"
- },
- "keywords": [],
- "scripts": {},
- "devDependencies": {},
- "dependencies": {
- },
- "peerDependencies": {}
-}
diff --git a/js/packages/dapp-chaindeploy/parity.js b/js/packages/dapp-chaindeploy/parity.js
deleted file mode 100644
index 742386288..000000000
--- a/js/packages/dapp-chaindeploy/parity.js
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import Api from '@parity/api';
-
-const ethereumProvider = window.ethereum || window.parent.ethereum;
-
-if (!ethereumProvider) {
- throw new Error('Unable to locate EthereumProvider, object not attached');
-}
-
-const api = new Api(ethereumProvider);
-
-export {
- api
-};
diff --git a/js/packages/dapp-chaindeploy/store.js b/js/packages/dapp-chaindeploy/store.js
deleted file mode 100644
index 07b693135..000000000
--- a/js/packages/dapp-chaindeploy/store.js
+++ /dev/null
@@ -1,714 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { action, computed, observable } from 'mobx';
-
-import { contracts as contractsInfo, registry as registryInfo } from './contracts';
-import { apps } from './dapps';
-import { api } from './parity';
-import { executeContract, isValidNumber, validateCode } from './utils';
-
-export default class ContractsStore {
- @observable apps = null;
- @observable badges = null;
- @observable contracts = null;
- @observable error = null;
- @observable registry = null;
-
- constructor () {
- this.apps = apps;
- this.badges = contractsInfo.filter((contract) => contract.isBadge);
- this.contracts = contractsInfo.filter((contract) => !contract.isBadge);
- this.registry = registryInfo;
-
- api.subscribe('eth_blockNumber', this.onNewBlockNumber);
- }
-
- @computed get contractBadgereg () {
- return this.contracts.find((contract) => contract.id === 'badgereg');
- }
-
- @computed get contractDappreg () {
- return this.contracts.find((contract) => contract.id === 'dappreg');
- }
-
- @computed get contractGithubhint () {
- return this.contracts.find((contract) => contract.id === 'githubhint');
- }
-
- @computed get contractTokenreg () {
- return this.contracts.find((contract) => contract.id === 'tokenreg');
- }
-
- @computed get isBadgeDeploying () {
- return this.badges
- .filter((contract) => contract.isDeploying)
- .length !== 0;
- }
-
- @computed get isContractDeploying () {
- return this.contracts
- .filter((contract) => contract.isDeploying)
- .length !== 0;
- }
-
- @computed get isDappDeploying () {
- return this.apps
- .filter((app) => app.isDeploying)
- .length !== 0;
- }
-
- @computed get haveAllBadges () {
- return this.badges
- .filter((contract) => !contract.instance || !contract.hasLatestCode || !contract.badgeImageHash || !contract.badgeImageMatch || !contract.isBadgeRegistered)
- .length === 0;
- }
-
- @computed get haveAllContracts () {
- return this.contracts
- .filter((contract) => !contract.instance || !contract.hasLatestCode)
- .length === 0;
- }
-
- @computed get haveAllDapps () {
- return this.apps
- .filter((app) => {
- return !app.isOnChain ||
- !app.imageHash || !app.imageMatch ||
- (app.source.contentHash && !app.contentMatch) ||
- (app.source.manifestHash && !app.manifestMatch);
- })
- .length === 0;
- }
-
- @action refreshApps = () => {
- this.apps = [].concat(this.apps.peek());
- }
-
- @action refreshContracts = () => {
- this.badges = [].concat(this.badges.peek());
- this.contracts = [].concat(this.contracts.peek());
- }
-
- @action setError = (error) => {
- console.error(error);
-
- this.error = error.message
- ? error.message
- : error;
- }
-
- @action setRegistryAddress = (address, isOnChain = false) => {
- if (this.registry.address !== address || !this.registry.instance) {
- console.log(`registry found at ${address}`);
-
- this.registry = Object.assign({}, this.registry, {
- address,
- instance: api.newContract(this.registry.abi, address).instance,
- isOnChain
- });
- }
- }
-
- @action setRegistryCode (byteCode) {
- this.registry.hasLatestCode = validateCode(this.registry.byteCode, byteCode);
- }
-
- @action setRegistryDeploying = (isDeploying = false) => {
- this.registry = Object.assign({}, this.registry, {
- isDeploying,
- status: isDeploying
- ? 'Deploying contract'
- : null
- });
- }
-
- @action setBadgeId = (badge, badgeId) => {
- badge.badgeId = badgeId;
- badge.isBadgeRegistered = true;
-
- this.refreshContracts();
- }
-
- @action setBadgeImageHash = (badge, imageHash) => {
- badge.badgeImageHash = imageHash;
- badge.badgeImageMatch = badge.badgeSource.imageHash === imageHash;
-
- this.refreshContracts();
- }
-
- @action setContractAddress = (contract, address, isOnChain = false) => {
- if (contract.address !== address || !contract.instance || contract.isOnChain !== isOnChain) {
- console.log(`${contract.id} found at ${address}`);
-
- contract.address = address;
- contract.instance = api.newContract(contract.abi, address).instance;
- contract.isOnChain = isOnChain;
-
- this.refreshContracts();
- }
- }
-
- @action setContractCode (contract, byteCode) {
- contract.hasLatestCode = validateCode(contract.byteCode, byteCode);
-
- this.refreshContracts();
- }
-
- @action setContractDeploying = (contract, isDeploying = false) => {
- contract.isDeploying = isDeploying;
- contract.status = isDeploying
- ? 'Deploying contract'
- : null;
-
- this.refreshContracts();
- }
-
- @action setContractStatus = (contract, status) => {
- contract.status = status;
-
- this.refreshContracts();
- }
-
- @action setAppDeploying = (app, isDeploying = false) => {
- app.isDeploying = isDeploying;
- app.status = isDeploying
- ? 'Registering app'
- : null;
-
- this.refreshApps();
- }
-
- @action setAppFound = (app, isOnChain = false) => {
- if (app.isOnChain !== isOnChain) {
- console.log(`${app.name} found on dappreg`);
-
- app.isOnChain = isOnChain;
-
- this.refreshApps();
- }
- }
-
- @action setAppContentHash = (app, contentHash) => {
- if (app.contentHash !== contentHash) {
- console.log(`${app.name} has contentHash ${contentHash}`);
-
- app.contentHash = contentHash;
- app.contentMatch = contentHash === app.source.contentHash;
-
- this.refreshApps();
- }
- }
-
- @action setAppImageHash = (app, imageHash) => {
- if (app.imageHash !== imageHash) {
- console.log(`${app.name} has imageHash ${imageHash}`);
-
- app.imageHash = imageHash;
- app.imageMatch = imageHash === app.source.imageHash;
-
- this.refreshApps();
- }
- }
-
- @action setAppManifestHash = (app, manifestHash) => {
- if (app.manifestHash !== manifestHash) {
- console.log(`${app.name} has manifestHash ${manifestHash}`);
-
- app.manifestHash = manifestHash;
- app.manifestMatch = manifestHash === app.source.manifestHash;
-
- this.refreshApps();
- }
- }
-
- @action setAppStatus = (app, status) => {
- console.log(app.id, status);
-
- app.status = status;
-
- this.refreshApps();
- }
-
- deployApp = (app) => {
- console.log(`Registering application ${app.id}`);
-
- this.setAppDeploying(app, true);
-
- const options = {};
- const values = [app.hashId];
-
- return api.parity
- .defaultAccount()
- .then((defaultAccount) => {
- options.from = defaultAccount;
-
- if (app.isOnChain) {
- return true;
- }
-
- return this.contractDappreg.instance
- .fee.call({}, [])
- .then((fee) => {
- options.value = fee;
-
- return executeContract(app.id, this.contractDappreg, 'register', options, values);
- });
- })
- .then(() => {
- if (app.imageHash && app.imageMatch) {
- return true;
- }
-
- this.setAppStatus(app, 'Registering image url');
-
- return this
- .registerHash(app.source.imageHash, app.source.imageUrl, options.from)
- .then(() => this.setAppMeta(app, 'IMG', app.source.imageHash, options.from));
- })
- .then(() => {
- if (!app.source.manifestHash || app.manifestMatch) {
- return true;
- }
-
- this.setAppStatus(app, 'Registering manifest url');
-
- return this
- .registerHash(app.source.manifestHash, app.source.manifestUrl, options.from)
- .then(() => this.setAppMeta(app, 'MANIFEST', app.source.manifestHash, options.from));
- })
- .then(() => {
- if (!app.source.contentHash || app.contentMatch) {
- return true;
- }
-
- this.setAppStatus(app, 'Registering content url');
-
- return this
- .registerRepo(app.source.contentHash, app.source.contentUrl, options.from)
- .then(() => this.setAppMeta(app, 'CONTENT', app.source.contentHash, options.from));
- })
- .catch(() => {
- return null;
- })
- .then(() => {
- this.setAppDeploying(app, false);
- });
- }
-
- deployApps = () => {
- this.apps
- .filter((app) => {
- return !app.isDeploying &&
- (
- !app.isOnChain ||
- (!app.imageHash || !app.imageMatch) ||
- (app.source.contentHash && !app.contentMatch) ||
- (app.source.manifestHash && !app.manifestMatch)
- );
- })
- .forEach(this.deployApp);
- }
-
- _deployContract = (contract) => {
- console.log(`Deploying contract ${contract.id}`);
-
- const options = {
- data: contract.byteCode
- };
-
- return api.parity
- .defaultAccount()
- .then((defaultAccount) => {
- options.from = defaultAccount;
-
- return api
- .newContract(contract.abi)
- .deploy(options, contract.deployParams, (error, data) => {
- if (error) {
- console.error(contract.id, error);
- } else {
- console.log(contract.id, data);
- }
- })
- .then((contractAddress) => {
- return [contractAddress, defaultAccount];
- });
- });
- }
-
- deployContract = (contract) => {
- if (contract.hasLatestCode) {
- return Promise.resolve(false);
- }
-
- let defaultAccount = '0x0';
-
- this.setContractDeploying(contract, true);
-
- return this
- ._deployContract(contract)
- .then(([address, _defaultAccount]) => {
- const isOnChain = contract.isOnChain;
-
- defaultAccount = _defaultAccount;
-
- this.setContractAddress(contract, address);
-
- return isOnChain
- ? true
- : this.reserveAddress(contract, defaultAccount);
- })
- .then(() => {
- return this.registerAddress(contract, defaultAccount);
- })
- .catch(() => {
- return null;
- })
- .then(() => {
- this.setContractDeploying(contract, false);
- });
- }
-
- deployBadge = (badge) => {
- let defaultAccount;
-
- return this
- .deployContract(badge)
- .then(() => {
- this.setContractDeploying(badge, true);
-
- return api.parity.defaultAccount();
- })
- .then((_defaultAccount) => {
- defaultAccount = _defaultAccount;
-
- if (badge.isBadgeRegistered) {
- return true;
- }
-
- this.setContractStatus(badge, 'Registering with badgereg');
-
- return this.registerBadge(badge, defaultAccount);
- })
- .then(() => {
- if (badge.badgeImageMatch) {
- return true;
- }
-
- this.setContractStatus(badge, 'Registering image url');
-
- return this
- .registerHash(badge.badgeSource.imageHash, badge.badgeSource.imageUrl, defaultAccount)
- .then(() => this.registerBadgeImage(badge, badge.badgeSource.imageHash, defaultAccount));
- })
- .then(() => {
- this.setContractDeploying(badge, false);
- });
- }
-
- deployContracts = () => {
- this.contracts
- .filter((contract) => !contract.isDeploying && (!contract.instance || !contract.hasLatestCode))
- .forEach(this.deployContract);
- }
-
- deployBadges = () => {
- this.badges
- .filter((contract) => !contract.isDeploying && (!contract.instance || !contract.hasLatestCode || !contract.badgeImageHash || !contract.badgeImageMatch || !contract.isBadgeRegistered))
- .forEach(this.deployBadge);
- }
-
- deployRegistry = () => {
- this.setRegistryDeploying(true);
-
- return this
- ._deployContract(this.registry)
- .then(([address]) => {
- this.setRegistryDeploying(false);
- this.setRegistryAddress(address);
- });
- }
-
- registerBadge = (badge, fromAddress) => {
- const options = {
- from: fromAddress
- };
- const values = [badge.address, api.util.sha3.text(badge.id.toLowerCase())];
-
- return this.contractBadgereg.instance
- .fee.call({}, [])
- .then((fee) => {
- options.value = fee;
-
- return executeContract(badge.id, this.contractBadgereg, 'register', options, values);
- });
- }
-
- registerBadgeImage = (badge, hash, fromAddress) => {
- const options = {
- from: fromAddress
- };
- const values = [badge.badgeId, 'IMG', hash];
-
- this.setContractStatus(badge, 'Setting meta IMG');
-
- return executeContract(badge.id, this.contractBadgereg, 'setMeta', options, values);
- }
-
- setAppMeta = (app, key, meta, fromAddress) => {
- const options = {
- from: fromAddress
- };
- const values = [app.hashId, key, meta];
-
- this.setAppStatus(app, `Setting meta ${key}`);
-
- return executeContract(app.id, this.contractDappreg, 'setMeta', options, values);
- }
-
- reserveAddress = (contract, fromAddress) => {
- const options = { from: fromAddress };
- const values = [api.util.sha3.text(contract.id.toLowerCase())];
-
- this.setContractStatus(contract, 'Reserving name');
-
- return this.registry.instance
- .fee.call({}, [])
- .then((value) => {
- options.value = value;
-
- return executeContract(contract.id, this.registry, 'reserve', options, values);
- });
- }
-
- registerAddress = (contract, fromAddress) => {
- const options = { from: fromAddress };
- const values = [api.util.sha3.text(contract.id.toLowerCase()), 'A', contract.address];
-
- this.setContractStatus(contract, 'Setting lookup address');
-
- return executeContract(contract.id, this.registry, 'setAddress', options, values);
- }
-
- registerRepo = (hash, content, fromAddress) => {
- const options = {
- from: fromAddress
- };
- const values = [hash, content.repo || content, content.commit || 0];
-
- return this.contractGithubhint.instance
- .entries.call({}, [hash])
- .then(([imageUrl, commit, owner]) => {
- if (isValidNumber(owner)) {
- return true;
- }
-
- return executeContract(hash, this.contractGithubhint, 'hint', options, values);
- })
- .catch(() => false);
- }
-
- registerHash = (hash, url, fromAddress) => {
- const options = {
- from: fromAddress
- };
- const values = [hash, url];
-
- return this.contractGithubhint.instance
- .entries.call({}, [hash])
- .then(([imageUrl, commit, owner]) => {
- if (isValidNumber(owner)) {
- return true;
- }
-
- return executeContract(hash, this.contractGithubhint, 'hintURL', options, values);
- })
- .catch(() => false);
- }
-
- findRegistry = () => {
- if (this.registry.address && this.registry.hasLatestCode) {
- return Promise.resolve(this.registry);
- }
-
- return api.parity
- .registryAddress()
- .then((address) => {
- if (isValidNumber(address)) {
- this.setRegistryAddress(address, true);
- }
-
- return api.eth.getCode(address);
- })
- .then((byteCode) => {
- this.setRegistryCode(byteCode);
- });
- }
-
- findApps = () => {
- if (!this.contractDappreg.instance) {
- return Promise.resolve(false);
- }
-
- return Promise
- .all(
- this.apps.map((app) => {
- return app.isOnChain
- ? Promise.resolve([[0]])
- : this.contractDappreg.instance.get.call({}, [app.hashId]);
- })
- )
- .then((apps) => {
- apps.forEach(([_id, owner], index) => {
- const id = api.util.bytesToHex(_id);
-
- if (isValidNumber(id)) {
- this.setAppFound(this.apps[index], true);
- }
- });
-
- return Promise.all(
- this.apps.map((app) => {
- return !app.isOnChain || (app.imageHash && app.imageMatch)
- ? Promise.resolve([[0], [0], [0]])
- : Promise.all([
- this.contractDappreg.instance.meta.call({}, [app.hashId, 'CONTENT']),
- this.contractDappreg.instance.meta.call({}, [app.hashId, 'IMG']),
- this.contractDappreg.instance.meta.call({}, [app.hashId, 'MANIFEST'])
- ]);
- })
- );
- })
- .then((hashes) => {
- hashes.forEach(([content, image, manifest], index) => {
- const contentHash = api.util.bytesToHex(content);
- const imageHash = api.util.bytesToHex(image);
- const manifestHash = api.util.bytesToHex(manifest);
-
- if (isValidNumber(contentHash)) {
- this.setAppContentHash(this.apps[index], contentHash);
- }
-
- if (isValidNumber(imageHash)) {
- this.setAppImageHash(this.apps[index], imageHash);
- }
-
- if (isValidNumber(manifestHash)) {
- this.setAppManifestHash(this.apps[index], manifestHash);
- }
- });
- });
- }
-
- findBadges = () => {
- if (!this.contractBadgereg.instance) {
- return Promise.resolve(false);
- }
-
- return this
- .findContracts(this.badges)
- .then(() => {
- return Promise.all(
- this.badges.map((badge) => {
- return badge.isBadgeRegistered
- ? Promise.resolve([0, 0, 0])
- : this.contractBadgereg.instance.fromAddress.call({}, [badge.address]);
- })
- );
- })
- .then((badgeInfos) => {
- badgeInfos.forEach(([id, name, owner], index) => {
- if (isValidNumber(owner)) {
- this.setBadgeId(this.badges[index], id);
- }
- });
-
- return Promise
- .all(
- this.badges.map((badge) => {
- return !badge.isBadgeRegistered
- ? Promise.resolve([0])
- : this.contractBadgereg.instance.meta.call({}, [badge.badgeId, 'IMG']);
- })
- );
- })
- .then((images) => {
- images.forEach((imageBytes, index) => {
- const imageHash = api.util.bytesToHex(imageBytes);
-
- if (isValidNumber(imageHash)) {
- this.setBadgeImageHash(this.badges[index], imageHash);
- }
- });
- });
- }
-
- findContracts = (contracts = this.contracts) => {
- if (!this.registry.instance) {
- return Promise.resolve(false);
- }
-
- return Promise
- .all(
- contracts.map((contract) => {
- const hashId = api.util.sha3.text(contract.id.toLowerCase());
-
- return contract.isOnChain
- ? Promise.resolve([0, 0])
- : Promise.all([
- this.registry.instance.getAddress.call({}, [hashId, 'A']),
- this.registry.instance.getOwner.call({}, [hashId])
- ]);
- })
- )
- .then((addresses) => {
- addresses.forEach(([address, owner], index) => {
- if (isValidNumber(owner) && isValidNumber(address)) {
- this.setContractAddress(contracts[index], address, true);
- }
- });
-
- return Promise.all(
- contracts.map((contract) => {
- return !contract.address || contract.hasLatestCode
- ? Promise.resolve(null)
- : api.eth.getCode(contract.address);
- })
- );
- })
- .then((codes) => {
- codes.forEach((byteCode, index) => {
- if (byteCode) {
- this.setContractCode(contracts[index], byteCode);
- }
- });
- });
- }
-
- onNewBlockNumber = (error, blockNumber) => {
- if (error) {
- return;
- }
-
- return this
- .findRegistry()
- .then(this.findContracts)
- .then(this.findApps)
- .then(this.findBadges)
- .catch(this.setError);
- }
-}
diff --git a/js/packages/dapp-chaindeploy/utils.js b/js/packages/dapp-chaindeploy/utils.js
deleted file mode 100644
index 87e7279e3..000000000
--- a/js/packages/dapp-chaindeploy/utils.js
+++ /dev/null
@@ -1,82 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import BigNumber from 'bignumber.js';
-
-import { api } from './parity';
-
-export function validateCode (source, retrieved) {
- const original = source.substr(12);
- const bytecode = retrieved.substr(12);
-
- const knownHash = api.util.sha3(original.slice(-1 * bytecode.length));
- const codeHash = api.util.sha3(bytecode);
-
- return knownHash === codeHash;
-}
-
-export function isValidNumber (number) {
- return number && !(new BigNumber(number)).isZero();
-}
-
-export function executeContract (logId, contract, funcName, options, values) {
- const func = contract.instance[funcName];
-
- return func
- .estimateGas(options, values)
- .then((gasEst) => {
- options.gas = gasEst.mul(1.2);
-
- return trackRequest(
- func.postTransaction(options, values),
- (error, data) => {
- if (error) {
- console.error(logId, error);
- } else {
- console.log(logId, data);
- }
- }
- );
- });
-}
-
-export function trackRequest (promise, callback) {
- return promise
- .then((requestId) => {
- callback(null, { state: 'checkRequest', requestId });
-
- return api.pollMethod('parity_checkRequest', requestId);
- })
- .then((txHash) => {
- callback(null, { state: 'getTransactionReceipt', txHash });
-
- return api.pollMethod('eth_getTransactionReceipt', txHash, (receipt) => {
- if (!receipt || !receipt.blockNumber || receipt.blockNumber.eq(0)) {
- return false;
- }
-
- return true;
- });
- })
- .then((receipt) => {
- callback(null, { state: 'hasReceipt', receipt });
- })
- .catch((error) => {
- callback(error);
-
- throw error;
- });
-}
diff --git a/js/packages/dapp-console/Application/application.css b/js/packages/dapp-console/Application/application.css
deleted file mode 100644
index eea2c030d..000000000
--- a/js/packages/dapp-console/Application/application.css
+++ /dev/null
@@ -1,65 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.app {
- display: flex;
- flex-direction: column;
- font-family: Arial, sans-serif;
- font-size: 11px;
- height: 100vh;
- overflow: hidden;
-}
-
-textarea,
-input {
- font-family: dejavu sans mono, monospace;
- outline: none;
-}
-
-code,
-pre {
- font-family: dejavu sans mono, monospace;
- font-size: 11px;
-}
-
-.header {
- flex: 0 0 auto;
-}
-
-.view {
- display: flex;
- flex: 1;
- flex-direction: column;
-}
-
-.eval {
- flex: 0 1 auto;
- font-family: dejavu sans mono, monospace;
- overflow: auto;
-}
-
-.input {
- border-top: 1px solid #eee;
- display: flex;
- flex: 1 1 auto;
- min-height: 50px;
-}
-
-.status {
- flex: 0 0 auto;
- font-family: dejavu sans mono, monospace;
-}
diff --git a/js/packages/dapp-console/Application/application.js b/js/packages/dapp-console/Application/application.js
deleted file mode 100644
index 5a591e710..000000000
--- a/js/packages/dapp-console/Application/application.js
+++ /dev/null
@@ -1,94 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { observer } from 'mobx-react';
-import React, { Component } from 'react';
-
-import { api } from '../parity';
-
-import Console from '../Console';
-import Header from '../Header';
-import Input from '../Input';
-import Settings from '../Settings';
-import Snippets from '../Snippets';
-import Watches from '../Watches';
-
-import ApplicationStore from './application.store';
-import WatchesStore from '../Watches/watches.store';
-
-import styles from './application.css';
-
-@observer
-export default class Application extends Component {
- application = ApplicationStore.get();
- watches = WatchesStore.get();
-
- componentWillMount () {
- this.watches.add('time', () => new Date());
- this.watches.add('blockNumber', api.eth.blockNumber, api);
- }
-
- render () {
- return (
-
- );
- }
-
- return null;
- }
-}
diff --git a/js/packages/dapp-console/Application/application.store.js b/js/packages/dapp-console/Application/application.store.js
deleted file mode 100644
index c10be46c6..000000000
--- a/js/packages/dapp-console/Application/application.store.js
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { action, observable } from 'mobx';
-
-let instance;
-
-export default class ApplicationStore {
- @observable view = this.views[0].id;
-
- views = [
- { label: 'Console', id: 'console' },
- { label: 'Snippets', id: 'snippets' },
- { label: 'Settings', id: 'settings' }
- ];
-
- static get () {
- if (!instance) {
- instance = new ApplicationStore();
- }
-
- return instance;
- }
-
- @action
- setView (view) {
- this.view = view;
- }
-}
diff --git a/js/packages/dapp-console/Application/index.js b/js/packages/dapp-console/Application/index.js
deleted file mode 100644
index 3d8d1ca3b..000000000
--- a/js/packages/dapp-console/Application/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './application';
diff --git a/js/packages/dapp-console/Autocomplete/autocomplete.css b/js/packages/dapp-console/Autocomplete/autocomplete.css
deleted file mode 100644
index 8d4585e7a..000000000
--- a/js/packages/dapp-console/Autocomplete/autocomplete.css
+++ /dev/null
@@ -1,55 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.container {
- background: #f8f8f8;
- box-shadow: 0 0.125em 0.25em rgba(0, 0, 0, 0.5);
- font-family: dejavu sans mono, monospace;
- left: 20px;
- position: absolute;
- max-height: 300px;
- overflow: auto;
-}
-
-.item {
- background-color: white;
- padding: 0.25em 0.25em 0.25em 0.35em;
- display: flex;
- justify-content: space-between;
-
- &.selected {
- background-color: rgb(64, 115, 244);
-
- &,
- .proto {
- color: white;
- }
- }
-
- &:hover {
- cursor: default;
- }
-
- &:hover:not(.selected) {
- background-color: rgb(230, 236, 255);
- }
-
- .proto {
- color: gray;
- margin-left: 1em;
- }
-}
diff --git a/js/packages/dapp-console/Autocomplete/autocomplete.js b/js/packages/dapp-console/Autocomplete/autocomplete.js
deleted file mode 100644
index e2938f23d..000000000
--- a/js/packages/dapp-console/Autocomplete/autocomplete.js
+++ /dev/null
@@ -1,96 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { observer } from 'mobx-react';
-import React, { Component } from 'react';
-import ReactDOM from 'react-dom';
-
-import AutocompleteStore from './autocomplete.store';
-
-import styles from './autocomplete.css';
-
-@observer
-export default class Autocomplete extends Component {
- autocompleteStore = AutocompleteStore.get();
-
- render () {
- if (!this.autocompleteStore.show) {
- return null;
- }
-
- return (
-
- );
- });
- }
-
- handleClick = (index) => {
- this.autocompleteStore.select(index);
- };
-
- setRef = (index, node) => {
- const element = ReactDOM.findDOMNode(node);
-
- this.autocompleteStore.setElement(index, element);
- };
-}
diff --git a/js/packages/dapp-console/Autocomplete/autocomplete.store.js b/js/packages/dapp-console/Autocomplete/autocomplete.store.js
deleted file mode 100644
index 82ff2f24d..000000000
--- a/js/packages/dapp-console/Autocomplete/autocomplete.store.js
+++ /dev/null
@@ -1,234 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { action, observable } from 'mobx';
-
-import { evaluate } from '../utils';
-
-let instance;
-
-export default class AutocompleteStore {
- @observable values = [];
- @observable position = {};
- @observable show = false;
- @observable selected = null;
-
- elements = {};
- inputNode = null;
- lastObject = null;
- lastObjectPropertyNames = [];
-
- static get () {
- if (!instance) {
- instance = new AutocompleteStore();
- }
-
- return instance;
- }
-
- get hasSelected () {
- return this.selected !== null;
- }
-
- clearCache () {
- this.lastObject = null;
- this.lastObjectPropertyNames = null;
- }
-
- @action
- focus (offset = 1) {
- if (this.values.length === 0) {
- this.selected = null;
- return;
- }
-
- this.selected = this.selected === null
- ? (
- offset === 1
- ? 0
- : this.values.length - 1
- )
- : (this.values.length + this.selected + offset) % (this.values.length);
-
- if (this.isVisible(this.selected)) {
- return;
- }
-
- const element = this.elements[this.selected];
-
- if (!element) {
- return;
- }
-
- element.scrollIntoView(offset === -1);
- }
-
- focusOnInput () {
- if (!this.inputNode) {
- return;
- }
-
- this.inputNode.focus();
- }
-
- @action
- hide () {
- this.show = false;
- this.selected = null;
- }
-
- isVisible (index) {
- const element = this.elements[index];
-
- if (!element) {
- return false;
- }
-
- const eBoundings = element.getBoundingClientRect();
- const pBoundings = element.parentElement.getBoundingClientRect();
-
- if (eBoundings.top < pBoundings.top || eBoundings.bottom > pBoundings.bottom) {
- return false;
- }
-
- return true;
- }
-
- select (inputStore, _index = this.selected) {
- const index = _index === null
- ? 0
- : _index;
-
- if (!this.values[index]) {
- console.warn(`autocomplete::select has been called on AutocompleteStore with wrong value ${index}`);
- return;
- }
-
- const { name } = this.values[index];
- const { input } = inputStore;
- const objects = input.split('.');
-
- objects[objects.length - 1] = name;
- const nextInput = objects.join('.');
-
- this.hide();
- this.focusOnInput();
- return inputStore.updateInput(nextInput, false);
- }
-
- setElement (index, element) {
- this.elements[index] = element;
- }
-
- setInputNode (node) {
- this.inputNode = node;
- }
-
- @action
- setPosition () {
- if (!this.inputNode) {
- return;
- }
-
- const inputBoundings = this.inputNode.getBoundingClientRect();
- const bodyBoundings = document.body.getBoundingClientRect();
-
- // display on bottom of input
- if (inputBoundings.top < bodyBoundings.height / 2) {
- const nextPosition = {
- top: 20
- };
-
- this.position = nextPosition;
- return;
- }
-
- // display on top of input
- const nextPosition = {
- bottom: inputBoundings.height
- };
-
- this.position = nextPosition;
- return;
- }
-
- @action
- setValues (values) {
- this.values = values;
- this.selected = null;
- const show = values.length > 0;
-
- // Reveal autocomplete
- if (!this.show && show) {
- this.setPosition();
- }
-
- this.show = show;
- }
-
- update (input) {
- if (input.length === 0) {
- return this.setValues([]);
- }
-
- const objects = input.split('.');
- const suffix = objects.pop().toLowerCase();
- const prefix = objects.join('.');
- const object = prefix.length > 0
- ? prefix
- : 'window';
-
- if (object !== this.lastObject) {
- const evalResult = evaluate(object);
-
- if (evalResult.error) {
- this.lastObjectProperties = [];
- } else {
- this.lastObjectProperties = getAllProperties(evalResult.result);
- }
-
- this.lastObject = object;
- }
-
- const autocompletes = this.lastObjectProperties.filter((property) => {
- return property.name.toLowerCase().includes(suffix);
- });
-
- return this.setValues(autocompletes);
- }
-}
-
-function getAllProperties (object) {
- const propertyNames = {};
-
- while (object) {
- const prototypeName = object && object.constructor && object.constructor.name || '';
-
- Object.getOwnPropertyNames(object)
- .sort()
- .forEach((name) => {
- if (Object.prototype.hasOwnProperty.call(propertyNames, name)) {
- return;
- }
-
- propertyNames[name] = { name, prototypeName };
- });
-
- object = Object.getPrototypeOf(object);
- }
-
- return Object.values(propertyNames);
-}
diff --git a/js/packages/dapp-console/Autocomplete/index.js b/js/packages/dapp-console/Autocomplete/index.js
deleted file mode 100644
index 5761be0e3..000000000
--- a/js/packages/dapp-console/Autocomplete/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './autocomplete';
diff --git a/js/packages/dapp-console/Console/console.css b/js/packages/dapp-console/Console/console.css
deleted file mode 100644
index a0b3db4ff..000000000
--- a/js/packages/dapp-console/Console/console.css
+++ /dev/null
@@ -1,58 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.result {
- border-top: 1px solid #eee;
- display: flex;
- font-family: dejavu sans mono, monospace;
- padding: 0.35em 0.25em;
-
- &.error {
- background-color: hsl(0, 100%, 97%);
-
- .text {
- color: red;
- }
- }
-
- &.warn {
- background-color: hsl(50, 100%, 95%);
- }
-}
-
-.type {
- font-weight: bold !important;
- font-size: 8pt;
- padding: 0 0.5em 0 0.25em;
-}
-
-.time {
- color: gray;
- padding: 0 1em 0 0.5em;
-}
-
-.token {
- white-space: pre-wrap;
-}
-
-.text {
- display: flex;
-}
-
-.text .token:not(:first-child) {
- margin-left: 0.5em;
-}
diff --git a/js/packages/dapp-console/Console/console.js b/js/packages/dapp-console/Console/console.js
deleted file mode 100644
index 75f9713a6..000000000
--- a/js/packages/dapp-console/Console/console.js
+++ /dev/null
@@ -1,118 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { observer } from 'mobx-react';
-import React, { Component } from 'react';
-import ReactDOM from 'react-dom';
-import { ObjectInspector } from 'react-inspector';
-
-import ConsoleStore from './console.store';
-import SettingsStore from '../Settings/settings.store';
-
-import styles from './console.css';
-
-const ICONS = {
- debug: ' ',
- error: '✖',
- info: 'ℹ',
- input: '>',
- log: ' ',
- result: '<',
- warn: '⚠'
-};
-
-@observer
-export default class Console extends Component {
- consoleStore = ConsoleStore.get();
- settingsStore = SettingsStore.get();
-
- render () {
- return (
-
- );
- });
- }
-
- renderTimestamp (timestamp) {
- const { displayTimestamps } = this.settingsStore;
-
- if (!displayTimestamps) {
- return null;
- }
-
- return (
-
- { new Date(timestamp).toISOString().slice(11, 23) }
-
- );
- }
-
- setRef = (node) => {
- const element = ReactDOM.findDOMNode(node);
-
- this.consoleStore.setNode(element);
- };
-
- toString (value) {
- if (typeof value === 'string') {
- return value;
- }
-
- if (value instanceof Error) {
- return value.toString();
- }
-
- return (
-
- );
- }
-}
diff --git a/js/packages/dapp-console/Console/console.store.js b/js/packages/dapp-console/Console/console.store.js
deleted file mode 100644
index dc2fc6db4..000000000
--- a/js/packages/dapp-console/Console/console.store.js
+++ /dev/null
@@ -1,126 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { action, observable } from 'mobx';
-
-import AutocompleteStore from '../Autocomplete/autocomplete.store';
-import { evaluate } from '../utils';
-
-let instance;
-
-export default class ConsoleStore {
- @observable logs = [];
-
- autocompleteStore = AutocompleteStore.get();
- logValues = [];
- node = null;
-
- constructor () {
- this.attachConsole();
- }
-
- static get () {
- if (!instance) {
- instance = new ConsoleStore();
- }
-
- return instance;
- }
-
- attachConsole () {
- ['debug', 'error', 'info', 'log', 'warn'].forEach((level) => {
- const old = window.console[level].bind(window.console);
-
- window.console[level] = (...args) => {
- old(...args);
- this.log({ type: level, values: args });
- };
- });
- }
-
- @action
- clear () {
- this.logs = [];
- this.logValues = [];
- }
-
- evaluate (input) {
- this.log({ type: 'input', value: input });
-
- setTimeout(() => {
- const { result, error } = evaluate(input);
- let value = error || result;
- const type = error
- ? 'error'
- : 'result';
-
- if (typeof value === 'string') {
- value = `"${value}"`;
- }
-
- if (value && typeof value === 'object' && typeof value.then === 'function') {
- return value
- .then((result) => {
- this.log({ type: 'result', value: result });
- })
- .catch((error) => {
- this.log({ type: 'error', value: error });
- });
- }
-
- this.log({ type, value });
- });
- }
-
- @action
- log ({ type, value, values }) {
- this.logs.push({
- type,
- timestamp: Date.now()
- });
-
- if (values) {
- this.logValues.push(values);
- } else {
- this.logValues.push([ value ]);
- }
-
- this.autocompleteStore.setPosition();
- this.scroll();
- }
-
- setNode (node) {
- this.node = node;
- this.scroll();
- }
-
- scroll () {
- if (!this.node) {
- return;
- }
-
- setTimeout(() => {
- if (this.node.children.length === 0) {
- return;
- }
-
- // Scroll to the last child
- this.node
- .children[this.node.children.length - 1]
- .scrollIntoView(false);
- }, 50);
- }
-}
diff --git a/js/packages/dapp-console/Console/index.js b/js/packages/dapp-console/Console/index.js
deleted file mode 100644
index 2956b330f..000000000
--- a/js/packages/dapp-console/Console/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './console';
diff --git a/js/packages/dapp-console/Header/header.css b/js/packages/dapp-console/Header/header.css
deleted file mode 100644
index 116de6b8c..000000000
--- a/js/packages/dapp-console/Header/header.css
+++ /dev/null
@@ -1,51 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.container {
- background-color: #f3f3f3;
- border-bottom: 1px solid #ccc;
- font-size: 12px;
- padding: 0 0.5em;
-}
-
-.tabs {
- display: flex;
-}
-
-.tab {
- align-items: center;
- box-sizing: border-box;
- border: 1px solid transparent;
- color: #333;
- cursor: default;
- display: flex;
- height: 24px;
- line-height: 15px;
- margin-top: 2px;
- padding: 2px 6px 2px 4px;
-
- &:hover,
- &.active:hover {
- background-color: #e5e5e5;
- }
-
- &.active {
- background-color: white;
- border: 1px solid #ccc;
- border-bottom: none;
- }
-}
diff --git a/js/packages/dapp-console/Header/header.js b/js/packages/dapp-console/Header/header.js
deleted file mode 100644
index c422b8256..000000000
--- a/js/packages/dapp-console/Header/header.js
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { observer } from 'mobx-react';
-import React, { Component } from 'react';
-
-import ApplicationStore from '../Application/application.store';
-
-import styles from './header.css';
-
-@observer
-export default class Header extends Component {
- application = ApplicationStore.get();
-
- render () {
- return (
-
- );
- });
- }
-
- handleClickTab = (id) => {
- this.application.setView(id);
- };
-}
diff --git a/js/packages/dapp-console/Header/index.js b/js/packages/dapp-console/Header/index.js
deleted file mode 100644
index aef90266f..000000000
--- a/js/packages/dapp-console/Header/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './header';
diff --git a/js/packages/dapp-console/Input/index.js b/js/packages/dapp-console/Input/index.js
deleted file mode 100644
index 29e00f72b..000000000
--- a/js/packages/dapp-console/Input/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './input';
diff --git a/js/packages/dapp-console/Input/input.css b/js/packages/dapp-console/Input/input.css
deleted file mode 100644
index 7b0c2306e..000000000
--- a/js/packages/dapp-console/Input/input.css
+++ /dev/null
@@ -1,46 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.type {
- color: #59f;
- font-weight: bold !important;
- font-size: 11px;
- padding: 0 0.5em 0 0.25em;
-}
-
-.inputContainer {
- flex: 1;
-}
-
-.input {
- border: 0;
- margin: 0;
- padding: 0;
- color: black;
- height: 100%;
- font-size: 11px;
- resize: none;
- width: 100%;
-}
-
-.container {
- border-top: 1px solid lightgray;
- display: flex;
- flex: 1;
- padding: 0.25em;
- position: relative;
-}
diff --git a/js/packages/dapp-console/Input/input.js b/js/packages/dapp-console/Input/input.js
deleted file mode 100644
index 3263aff38..000000000
--- a/js/packages/dapp-console/Input/input.js
+++ /dev/null
@@ -1,145 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import keycode from 'keycode';
-import { observer } from 'mobx-react';
-import React, { Component } from 'react';
-import ReactDOM from 'react-dom';
-
-import Autocomplete from '../Autocomplete';
-
-import AutocompleteStore from '../Autocomplete/autocomplete.store';
-import ConsoleStore from '../Console/console.store';
-import InputStore from './input.store';
-import SettingsStore from '../Settings/settings.store';
-
-import styles from './input.css';
-
-@observer
-export default class Input extends Component {
- autocompleteStore = AutocompleteStore.get();
- consoleStore = ConsoleStore.get();
- inputStore = InputStore.get();
- settingsStore = SettingsStore.get();
-
- render () {
- const { input } = this.inputStore;
-
- return (
-
-
- >
-
-
-
-
- );
- }
-
- handleChange = (event) => {
- const { value } = event.target;
-
- this.inputStore.updateInput(value);
- };
-
- handleKeyDown = (event) => {
- const { executeOnEnter } = this.settingsStore;
- const { input } = this.inputStore;
- const codeName = keycode(event);
- const multilines = input.split('\n').length > 1;
-
- // Clear console with CTRL+L
- if (codeName === 'l' && event.ctrlKey) {
- event.preventDefault();
- event.stopPropagation();
- return this.consoleStore.clear();
- }
-
- if (codeName === 'esc') {
- event.preventDefault();
- event.stopPropagation();
- return this.autocompleteStore.hide();
- }
-
- if (codeName === 'enter') {
- if (event.shiftKey) {
- return;
- }
-
- // If not execute on enter: execute on
- // enter + CTRL
- if (!executeOnEnter && !event.ctrlKey) {
- return;
- }
-
- event.preventDefault();
- event.stopPropagation();
-
- if (this.autocompleteStore.hasSelected) {
- return this.autocompleteStore.select(this.inputStore);
- }
-
- if (input.length > 0) {
- return this.inputStore.execute();
- }
- }
-
- if (codeName === 'up' && !multilines) {
- event.preventDefault();
- event.stopPropagation();
-
- if (this.autocompleteStore.show) {
- return this.autocompleteStore.focus(-1);
- }
-
- return this.inputStore.selectHistory(-1);
- }
-
- if (codeName === 'down' && !multilines) {
- event.preventDefault();
- event.stopPropagation();
-
- if (this.autocompleteStore.show) {
- return this.autocompleteStore.focus(1);
- }
-
- return this.inputStore.selectHistory(1);
- }
-
- if (codeName === 'left' && this.autocompleteStore.show) {
- return this.autocompleteStore.hide();
- }
-
- if (codeName === 'right' && this.autocompleteStore.show) {
- event.preventDefault();
- event.stopPropagation();
- return this.autocompleteStore.select(this.inputStore);
- }
- };
-
- setRef = (node) => {
- this.inputStore.setInputNode(ReactDOM.findDOMNode(node));
- };
-}
diff --git a/js/packages/dapp-console/Input/input.store.js b/js/packages/dapp-console/Input/input.store.js
deleted file mode 100644
index 9d8c2b51a..000000000
--- a/js/packages/dapp-console/Input/input.store.js
+++ /dev/null
@@ -1,124 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { action, observable } from 'mobx';
-import store from 'store';
-
-import AutocompleteStore from '../Autocomplete/autocomplete.store';
-import ConsoleStore from '../Console/console.store';
-
-const LS_HISTORY_KEY = '_console::history';
-const MAX_HISTORY_LINES = 5;
-
-let instance;
-
-export default class InputStore {
- @observable input = '';
-
- autocompleteStore = AutocompleteStore.get();
- consoleStore = ConsoleStore.get();
- history = [];
- historyOffset = null;
- inputNode = null;
- lastInput = '';
-
- constructor () {
- this.loadHistory();
- }
-
- static get () {
- if (!instance) {
- instance = new InputStore();
- }
-
- return instance;
- }
-
- setInputNode (node) {
- this.inputNode = node;
- this.autocompleteStore.setInputNode(node);
- }
-
- @action
- updateInput (nextValue = '', updateAutocomplete = true) {
- this.input = nextValue;
- const multilines = nextValue.split('\n').length > 1;
-
- if (updateAutocomplete && !multilines) {
- this.autocompleteStore.update(nextValue);
- }
- }
-
- selectHistory (_offset) {
- // No history
- if (this.history.length === 0) {
- return;
- }
-
- if (this.historyOffset === null) {
- // Can't go down if no history selected
- if (_offset === 1) {
- return;
- }
-
- this.historyOffset = this.history.length - 1;
- this.lastInput = this.input;
- return this.updateInput(this.history[this.historyOffset], false);
- }
-
- if (_offset === 1 && this.historyOffset === this.history.length - 1) {
- this.historyOffset = null;
- return this.updateInput(this.lastInput);
- }
-
- this.historyOffset = Math.max(0, this.historyOffset + _offset);
- const nextInput = this.history[this.historyOffset];
-
- this.updateInput(nextInput, false);
- }
-
- execute () {
- const { input } = this;
-
- this.pushToHistory(input);
- this.consoleStore.evaluate(input);
- this.updateInput('');
- this.historyOffset = null;
- this.autocompleteStore.clearCache();
- }
-
- pushToHistory (input) {
- // Don't stack twice the same input in
- // history
- if (this.history[this.history.length - 1] !== input) {
- this.history.push(input);
- }
-
- this.saveHistory();
- }
-
- loadHistory () {
- this.history = store.get(LS_HISTORY_KEY) || [];
- }
-
- saveHistory () {
- if (this.history.length > MAX_HISTORY_LINES) {
- this.history = this.history.slice(-1 * MAX_HISTORY_LINES);
- }
-
- store.set(LS_HISTORY_KEY, this.history.slice());
- }
-}
diff --git a/js/packages/dapp-console/Settings/index.js b/js/packages/dapp-console/Settings/index.js
deleted file mode 100644
index a148ded7a..000000000
--- a/js/packages/dapp-console/Settings/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './settings';
diff --git a/js/packages/dapp-console/Settings/settings.css b/js/packages/dapp-console/Settings/settings.css
deleted file mode 100644
index 8dbe7e743..000000000
--- a/js/packages/dapp-console/Settings/settings.css
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.container {
- display: flex;
- flex-direction: row;
- font-family: Arial, sans-serif;
- font-size: 12px;
- padding: 0.5em 1em;
-}
-
-.option {
- align-items: center;
- display: flex;
- flex: 0 0 50%;
- flex-direction: row;
- margin: 0.5em 0;
-}
diff --git a/js/packages/dapp-console/Settings/settings.js b/js/packages/dapp-console/Settings/settings.js
deleted file mode 100644
index 63ae9023f..000000000
--- a/js/packages/dapp-console/Settings/settings.js
+++ /dev/null
@@ -1,70 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { observer } from 'mobx-react';
-import React, { Component } from 'react';
-
-import SettingsStore from './settings.store';
-
-import styles from './settings.css';
-
-@observer
-export default class Settings extends Component {
- settingsStore = SettingsStore.get();
-
- render () {
- const { displayTimestamps, executeOnEnter } = this.settingsStore;
-
- return (
-
-
-
-
-
-
-
-
-
-
- );
- }
-
- handleDisplayTimestampsChange = (event) => {
- const { checked } = event.target;
-
- this.settingsStore.setDisplayTimestamps(checked);
- };
-
- handleExecuteOnEnterChange = (event) => {
- const { checked } = event.target;
-
- this.settingsStore.setExecuteOnEnter(checked);
- };
-}
diff --git a/js/packages/dapp-console/Settings/settings.store.js b/js/packages/dapp-console/Settings/settings.store.js
deleted file mode 100644
index 4c23f8341..000000000
--- a/js/packages/dapp-console/Settings/settings.store.js
+++ /dev/null
@@ -1,71 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { action, observable } from 'mobx';
-import store from 'store';
-
-const LS_SETTINGS_KEY = '_console::settings';
-
-let instance;
-
-export default class SettingsStore {
- @observable displayTimestamps = true;
- @observable executeOnEnter = true;
-
- constructor () {
- this.load();
- }
-
- static get () {
- if (!instance) {
- instance = new SettingsStore();
- }
-
- return instance;
- }
-
- load () {
- const settings = store.get(LS_SETTINGS_KEY) || {};
- const { executeOnEnter, displayTimestamps } = settings;
-
- if (executeOnEnter !== undefined) {
- this.setExecuteOnEnter(executeOnEnter);
- }
-
- if (displayTimestamps !== undefined) {
- this.setDisplayTimestamps(displayTimestamps);
- }
- }
-
- save () {
- const { executeOnEnter, displayTimestamps } = this;
- const settings = { executeOnEnter, displayTimestamps };
-
- store.set(LS_SETTINGS_KEY, settings);
- }
-
- @action
- setDisplayTimestamps (value) {
- this.displayTimestamps = value;
- this.save();
- }
-
- @action
- setExecuteOnEnter (value) {
- this.executeOnEnter = value;
- this.save();
- }
-}
diff --git a/js/packages/dapp-console/Snippets/index.js b/js/packages/dapp-console/Snippets/index.js
deleted file mode 100644
index 48dd44601..000000000
--- a/js/packages/dapp-console/Snippets/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './snippets';
diff --git a/js/packages/dapp-console/Snippets/snippets.css b/js/packages/dapp-console/Snippets/snippets.css
deleted file mode 100644
index a5004de1c..000000000
--- a/js/packages/dapp-console/Snippets/snippets.css
+++ /dev/null
@@ -1,122 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.container {
- display: flex;
- flex: 1;
- flex-direction: row;
-}
-
-.panel {
- border-right: 1px solid lightgray;
- display: flex;
- flex-direction: column;
- min-width: 200px;
-}
-
-.add {
- align-items: center;
- background-color: #fcfcfc;
- border-bottom: 1px solid lightgray;
- cursor: default;
- display: flex;
- padding: 0.5em 1em;
-
- .plus {
- font-size: 15px;
- font-weight: bold !important;
- margin-right: 5px;
- }
-
- &:hover {
- background-color: #f0f0f0;
- }
-}
-
-.list {
- display: flex;
- flex-direction: column;
- margin-top: 3px;
-}
-
-.code {
- display: flex;
- flex: 1;
- flex-direction: column;
-
- .console {
- border-top: 1px solid lightgray;
- max-height: 200px;
- flex: 0 0 0;
-
- > * {
- overflow: auto;
- height: 100%;
- }
- }
-
- > * {
- flex: 1;
- }
-
- :global(.CodeMirror) {
- height: 100%;
- }
-}
-
-.file {
- align-items: center;
- cursor: default;
- display: flex;
- padding: 0.5em 0.5em 0.5em 1em;
-
- &.selected {
- background-color: #f0f0f0;
- }
-
- &:hover {
- background-color: rgb(230, 236, 255);
- }
-
- .pristine {
- font-size: 20px;
- margin-right: 3px;
- height: 13px;
- }
-
- .remove {
- cursor: default;
- display: inline-flex;
- font-size: 14px;
- margin-left: -0.25em;
- margin-right: 0.25em;
- }
-}
-
-.inputContainer {
- background-color: white;
- border: solid 1px #d8d8d8;
- margin-right: 0.5em;
- padding: 3px;
- width: 100%;
-}
-
-.input {
- border: none;
- font: 11px Arial;
- width: 100%;
-}
diff --git a/js/packages/dapp-console/Snippets/snippets.js b/js/packages/dapp-console/Snippets/snippets.js
deleted file mode 100644
index eeb9459cf..000000000
--- a/js/packages/dapp-console/Snippets/snippets.js
+++ /dev/null
@@ -1,221 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import keycode from 'keycode';
-import { observer } from 'mobx-react';
-import React, { Component } from 'react';
-import CodeMirror from 'react-codemirror';
-import EventListener from 'react-event-listener';
-
-import Console from '../Console';
-import SnippetsStore from './snippets.store';
-
-import styles from './snippets.css';
-
-@observer
-export default class Snippets extends Component {
- snippetsStore = SnippetsStore.get();
-
- render () {
- const { code } = this.snippetsStore;
-
- return (
-
- );
- }
-
- renderAddressName (address, withName = true) {
- return (
-
-
- {
- withName
- ?
- : address
- }
-
- );
- }
-
- renderParam (name, param) {
- // Don't add a label id the name is an index key (ie. a Number)
- const label = parseInt(name).toString() === name.toString()
- ? undefined
- : name;
-
- return (
-
- );
- }
-
- formatBlockTimestamp (block) {
- if (!block) {
- return null;
- }
-
- return moment(block.timestamp).fromNow();
- }
-
- formatNumber (number) {
- if (!number) {
- return null;
- }
-
- return new BigNumber(number).toFormat();
- }
-
- retrieveTransaction () {
- const { api } = this.context;
- const { event } = this.props;
-
- Promise
- .all([
- api.parity.getBlockHeaderByNumber(event.blockNumber),
- api.eth.getTransactionByHash(event.transactionHash)
- ])
- .then(([block, transaction]) => {
- this.setState({ block, transaction });
- })
- .catch((error) => {
- console.warn('retrieveTransaction', error);
- });
- }
-}
diff --git a/js/packages/dapp-contract/Events/Event/index.js b/js/packages/dapp-contract/Events/Event/index.js
deleted file mode 100644
index 25441954b..000000000
--- a/js/packages/dapp-contract/Events/Event/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './event';
diff --git a/js/packages/dapp-contract/Events/events.js b/js/packages/dapp-contract/Events/events.js
deleted file mode 100644
index b3f7fdd4a..000000000
--- a/js/packages/dapp-contract/Events/events.js
+++ /dev/null
@@ -1,111 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-import { uniq } from 'lodash';
-
-import { Container, Loading } from '@parity/ui';
-
-import Event from './Event';
-import styles from '../contract.css';
-
-const TITLE = (
-
-);
-
-export default class Events extends Component {
- static contextTypes = {
- api: PropTypes.object
- };
-
- static propTypes = {
- isLoading: PropTypes.bool,
- events: PropTypes.array,
- netVersion: PropTypes.string.isRequired
- };
-
- static defaultProps = {
- isLoading: false,
- events: []
- };
-
- shouldComponentUpdate (nextProps) {
- return (nextProps.events !== this.props.events) ||
- (nextProps.netVersion !== this.props.netVersion) ||
- (nextProps.isLoading !== this.props.isLoading);
- }
-
- render () {
- const { events, isLoading, netVersion } = this.props;
-
- if (isLoading) {
- return (
-
-
-
- );
- }
-
- if (!events || !events.length) {
- return (
-
-
-
- );
- }
-}
diff --git a/js/packages/dapp-contract/Events/index.js b/js/packages/dapp-contract/Events/index.js
deleted file mode 100644
index d2d0080b3..000000000
--- a/js/packages/dapp-contract/Events/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './events';
diff --git a/js/packages/dapp-contract/ExecuteContract/AdvancedStep/advancedStep.js b/js/packages/dapp-contract/ExecuteContract/AdvancedStep/advancedStep.js
deleted file mode 100644
index 148a4999a..000000000
--- a/js/packages/dapp-contract/ExecuteContract/AdvancedStep/advancedStep.js
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-
-import { GasPriceEditor } from '@parity/ui';
-
-import styles from '../executeContract.css';
-
-export default class AdvancedStep extends Component {
- static propTypes = {
- gasStore: PropTypes.object.isRequired
- };
-
- render () {
- const { gasStore } = this.props;
-
- return (
-
-
-
- );
- }
-}
diff --git a/js/packages/dapp-contract/ExecuteContract/AdvancedStep/index.js b/js/packages/dapp-contract/ExecuteContract/AdvancedStep/index.js
deleted file mode 100644
index bd7a50eb4..000000000
--- a/js/packages/dapp-contract/ExecuteContract/AdvancedStep/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './advancedStep';
diff --git a/js/packages/dapp-contract/ExecuteContract/DetailsStep/detailsStep.js b/js/packages/dapp-contract/ExecuteContract/DetailsStep/detailsStep.js
deleted file mode 100644
index f562e0a4b..000000000
--- a/js/packages/dapp-contract/ExecuteContract/DetailsStep/detailsStep.js
+++ /dev/null
@@ -1,209 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-
-import { AddressSelect, Checkbox, Dropdown, Form, Input, TypedInput } from '@parity/ui';
-
-import styles from '../executeContract.css';
-
-const CHECK_STYLE = {
- position: 'absolute',
- top: '38px',
- left: '1em'
-};
-
-export default class DetailsStep extends Component {
- static propTypes = {
- advancedOptions: PropTypes.bool,
- accounts: PropTypes.object.isRequired,
- amount: PropTypes.string,
- amountError: PropTypes.string,
- contract: PropTypes.object.isRequired,
- fromAddress: PropTypes.string,
- fromAddressError: PropTypes.string,
- func: PropTypes.object,
- funcError: PropTypes.string,
- onAdvancedClick: PropTypes.func,
- onAmountChange: PropTypes.func.isRequired,
- onFromAddressChange: PropTypes.func.isRequired,
- onFuncChange: PropTypes.func,
- onValueChange: PropTypes.func.isRequired,
- values: PropTypes.array.isRequired,
- valuesError: PropTypes.array.isRequired,
- warning: PropTypes.string
- }
-
- render () {
- const { accounts, advancedOptions, amount, amountError, fromAddress, fromAddressError, onAdvancedClick, onAmountChange, onFromAddressChange } = this.props;
-
- return (
-
- );
- }
-
- renderFunctionSelect () {
- const { func, funcError, contract } = this.props;
-
- if (!func) {
- return null;
- }
-
- const functions = contract.functions
- .filter((func) => !func.constant)
- .sort((a, b) => (a.name || '').localeCompare(b.name || ''))
- .map((func) => {
- const params = (func.abi.inputs || []).map((input, index) => {
- return (
-
- { index ? ', ' : '' }
- { input.name }:
- { input.type }
-
- );
- });
- const name = (
-
- );
- });
- }
-
- onFuncChange = (event, signature) => {
- const { contract, onFuncChange } = this.props;
-
- onFuncChange(event, contract.functions.find((fn) => fn.signature === signature));
- }
-}
diff --git a/js/packages/dapp-contract/ExecuteContract/DetailsStep/detailsStep.spec.js b/js/packages/dapp-contract/ExecuteContract/DetailsStep/detailsStep.spec.js
deleted file mode 100644
index a9dc62fae..000000000
--- a/js/packages/dapp-contract/ExecuteContract/DetailsStep/detailsStep.spec.js
+++ /dev/null
@@ -1,61 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { shallow } from 'enzyme';
-import React from 'react';
-import sinon from 'sinon';
-
-import DetailsStep from './';
-
-import { CONTRACT } from '../executeContract.test.js';
-
-let component;
-let onAmountChange;
-let onClose;
-let onFromAddressChange;
-let onFuncChange;
-let onGasEditClick;
-let onValueChange;
-
-function render (props) {
- onAmountChange = sinon.stub();
- onClose = sinon.stub();
- onFromAddressChange = sinon.stub();
- onFuncChange = sinon.stub();
- onGasEditClick = sinon.stub();
- onValueChange = sinon.stub();
-
- component = shallow(
-
- );
-
- return component;
-}
-
-describe('modals/ExecuteContract/DetailsStep', () => {
- it('renders', () => {
- expect(render({ accounts: {}, values: [ true ], valuesError: [ null ] })).to.be.ok;
- });
-});
diff --git a/js/packages/dapp-contract/ExecuteContract/DetailsStep/index.js b/js/packages/dapp-contract/ExecuteContract/DetailsStep/index.js
deleted file mode 100644
index 4ad4b3ded..000000000
--- a/js/packages/dapp-contract/ExecuteContract/DetailsStep/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './detailsStep';
diff --git a/js/packages/dapp-contract/ExecuteContract/executeContract.css b/js/packages/dapp-contract/ExecuteContract/executeContract.css
deleted file mode 100644
index a8fb5f9e9..000000000
--- a/js/packages/dapp-contract/ExecuteContract/executeContract.css
+++ /dev/null
@@ -1,61 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.funcparams {
- padding-left: 3em;
-}
-
-.gaseditor {
- margin-top: 1em;
-}
-
-.paramname {
- color: #aaa;
-}
-
-.modalbody,
-.modalcenter {
-}
-
-.modalcenter {
- text-align: center;
-}
-
-.txhash {
- word-break: break-all;
-}
-
-.warning {
- border-radius: 0.5em;
- background: #f80;
- color: white;
- font-size: 0.75em;
- padding: 0.75em;
- text-align: center;
-}
-
-.columns {
- display: flex;
- flex-wrap: wrap;
- position: relative;
-
- &>div {
- flex: 0 1 50%;
- width: 50%;
- position: relative;
- }
-}
diff --git a/js/packages/dapp-contract/ExecuteContract/executeContract.js b/js/packages/dapp-contract/ExecuteContract/executeContract.js
deleted file mode 100644
index 0b01b18ce..000000000
--- a/js/packages/dapp-contract/ExecuteContract/executeContract.js
+++ /dev/null
@@ -1,347 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { observer } from 'mobx-react';
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-import { connect } from 'react-redux';
-
-import { toWei } from '@parity/api/util/wei';
-import { MAX_GAS_ESTIMATION } from '@parity/shared/util/constants';
-import { validateAddress, validateUint } from '@parity/shared/util/validation';
-import { parseAbiType } from '@parity/shared/util/abi';
-import { Button, GasPriceEditor, IdentityIcon, Portal, Warning } from '@parity/ui';
-import { CancelIcon, NextIcon, PrevIcon } from '@parity/ui/Icons';
-
-import AdvancedStep from './AdvancedStep';
-import DetailsStep from './DetailsStep';
-
-const STEP_DETAILS = 0;
-
-const TITLES = {
- transfer: (
-
- ),
- advanced: (
-
- )
-};
-const STAGES_BASIC = [TITLES.transfer];
-const STAGES_ADVANCED = [TITLES.transfer, TITLES.advanced];
-
-@observer
-class ExecuteContract extends Component {
- static contextTypes = {
- api: PropTypes.object.isRequired,
- store: PropTypes.object.isRequired
- };
-
- static propTypes = {
- accounts: PropTypes.object,
- contract: PropTypes.object.isRequired,
- fromAddress: PropTypes.string,
- gasLimit: PropTypes.object.isRequired,
- onClose: PropTypes.func.isRequired,
- onFromAddressChange: PropTypes.func.isRequired
- };
-
- gasStore = new GasPriceEditor.Store(this.context.api, { gasLimit: this.props.gasLimit });
-
- state = {
- advancedOptions: false,
- amount: '0',
- amountError: null,
- fromAddressError: null,
- func: null,
- funcError: null,
- step: STEP_DETAILS,
- values: [],
- valuesError: []
- };
-
- componentDidMount () {
- const { contract } = this.props;
- const functions = contract.functions
- .filter((func) => !func.constant)
- .sort((a, b) => (a.name || '').localeCompare(b.name || ''));
-
- this.onFuncChange(null, functions[0]);
- }
-
- componentWillReceiveProps (newProps) {
- if (newProps.fromAddress !== this.props.fromAddress) {
- this.estimateGas(newProps.fromAddress);
- }
- }
-
- render () {
- const { advancedOptions, step } = this.state;
- const steps = advancedOptions ? STAGES_ADVANCED : STAGES_BASIC;
-
- return (
-
- { this.renderExceptionWarning() }
- { this.renderStep() }
-
- );
- }
-
- renderExceptionWarning () {
- const { errorEstimated } = this.gasStore;
-
- if (!errorEstimated) {
- return null;
- }
-
- return (
-
- );
- }
-
- renderDialogActions () {
- const { fromAddress } = this.props;
- const { advancedOptions, step, fromAddressError, valuesError } = this.state;
- const hasError = !!(fromAddressError || valuesError.find((error) => error));
-
- const cancelBtn = (
-
- }
- icon={ }
- onClick={ this.onClose }
- />
- );
- const postBtn = (
-
- }
- disabled={ hasError }
- icon={ }
- onClick={ this.postTransaction }
- />
- );
- const nextBtn = (
-
- }
- icon={ }
- onClick={ this.onNextClick }
- />
- );
- const prevBtn = (
-
- }
- icon={ }
- onClick={ this.onPrevClick }
- />
- );
-
- if (step === STEP_DETAILS) {
- return [
- cancelBtn,
- advancedOptions ? nextBtn : postBtn
- ];
- }
-
- return [
- cancelBtn,
- prevBtn,
- postBtn
- ];
- }
-
- renderStep () {
- const { accounts, contract, fromAddress, onFromAddressChange } = this.props;
- const { step } = this.state;
-
- if (step === STEP_DETAILS) {
- return (
-
- );
- }
-
- return (
-
- );
- }
-
- onAmountChange = (amount) => {
- this.gasStore.setEthValue(amount);
- this.setState({ amount }, this.estimateGas);
- }
-
- onFuncChange = (event, func) => {
- const values = (func.abi.inputs || []).map((input) => {
- const parsedType = parseAbiType(input.type);
-
- return parsedType.default;
- });
-
- this.setState({
- func,
- values
- }, this.estimateGas);
- }
-
- onValueChange = (event, index, _value) => {
- const { func, values, valuesError } = this.state;
- const input = func.inputs.find((input, _index) => index === _index);
- let value = _value;
- let valueError = null;
-
- switch (input.kind.type) {
- case 'address':
- valueError = validateAddress(_value).addressError;
- break;
-
- case 'uint':
- valueError = validateUint(_value).valueError;
- break;
- }
-
- values[index] = value;
- valuesError[index] = valueError;
-
- this.setState({
- values: [].concat(values),
- valuesError: [].concat(valuesError)
- }, () => {
- if (!valueError) {
- this.estimateGas();
- }
- });
- }
-
- estimateGas = (_fromAddress) => {
- const { fromAddress } = this.props;
- const { amount, func, values } = this.state;
- const options = {
- gas: MAX_GAS_ESTIMATION,
- from: _fromAddress || fromAddress,
- value: toWei(amount || 0)
- };
-
- if (!func) {
- return;
- }
-
- func
- .estimateGas(options, values)
- .then((gasEst) => {
- const gas = gasEst.mul(1.2);
-
- console.log(`estimateGas: received ${gasEst.toFormat(0)}, adjusted to ${gas.toFormat(0)}`);
-
- this.gasStore.setEstimated(gasEst.toFixed(0));
- this.gasStore.setGas(gas.toFixed(0));
- })
- .catch((error) => {
- this.gasStore.setEstimatedError();
- console.warn('estimateGas', error);
- });
- }
-
- postTransaction = () => {
- const { api } = this.context;
- const { fromAddress } = this.props;
- const { amount, func, values } = this.state;
-
- const options = this.gasStore.overrideTransaction({
- from: fromAddress,
- value: api.util.toWei(amount || 0)
- });
-
- func.postTransaction(options, values);
- this.onClose();
- }
-
- onAdvancedClick = () => {
- this.setState({
- advancedOptions: !this.state.advancedOptions
- });
- }
-
- onNextClick = () => {
- this.setState({
- step: this.state.step + 1
- });
- }
-
- onPrevClick = () => {
- this.setState({
- step: this.state.step - 1
- });
- }
-
- onClose = () => {
- this.props.onClose();
- }
-}
-
-function mapStateToProps (state) {
- const { gasLimit } = state.nodeStatus;
-
- return { gasLimit };
-}
-
-export default connect(
- mapStateToProps,
- null
-)(ExecuteContract);
diff --git a/js/packages/dapp-contract/ExecuteContract/executeContract.spec.js b/js/packages/dapp-contract/ExecuteContract/executeContract.spec.js
deleted file mode 100644
index 7e0e1c79a..000000000
--- a/js/packages/dapp-contract/ExecuteContract/executeContract.spec.js
+++ /dev/null
@@ -1,70 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { shallow } from 'enzyme';
-import React from 'react';
-import sinon from 'sinon';
-
-import ExecuteContract from './';
-
-import { createApi, CONTRACT, STORE } from './executeContract.test.js';
-
-let component;
-let onClose;
-let onFromAddressChange;
-
-function render (props) {
- onClose = sinon.stub();
- onFromAddressChange = sinon.stub();
-
- component = shallow(
- ,
- { context: { api: createApi(), store: STORE } }
- ).find('ExecuteContract').shallow();
-
- return component;
-}
-
-describe('views/Contract/ExecuteContract', () => {
- it('renders', () => {
- expect(render({ accounts: {} })).to.be.ok;
- });
-
- describe('instance functions', () => {
- beforeEach(() => {
- render({
- accounts: {}
- });
- });
-
- describe('onValueChange', () => {
- it('toggles boolean from false to true', () => {
- component.setState({
- func: CONTRACT.functions[0],
- values: [false]
- });
- component.instance().onValueChange(null, 0, true);
-
- expect(component.state().values).to.deep.equal([true]);
- });
- });
- });
-});
diff --git a/js/packages/dapp-contract/ExecuteContract/executeContract.test.js b/js/packages/dapp-contract/ExecuteContract/executeContract.test.js
deleted file mode 100644
index 7b4fb9c3e..000000000
--- a/js/packages/dapp-contract/ExecuteContract/executeContract.test.js
+++ /dev/null
@@ -1,86 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import BigNumber from 'bignumber.js';
-import sinon from 'sinon';
-
-const CONTRACT = {
- functions: [
- {
- name: 'test_a',
- signature: 'test_a',
- estimateGas: sinon.stub().resolves(new BigNumber(123)),
- inputs: [
- {
- name: 'test_bool',
- kind: {
- type: 'bool'
- }
- }
- ],
- abi: {
- inputs: [
- {
- name: 'test_bool',
- type: 'bool'
- }
- ]
- }
- }
- ]
-};
-
-const STORE = {
- dispatch: sinon.stub(),
- subscribe: sinon.stub(),
- getState: () => {
- return {
- balances: {
- balances: {}
- },
- nodeStatus: {
- gasLimit: new BigNumber(123)
- },
- personal: {
- accountsInfo: {}
- },
- settings: {
- backgroundSeed: ''
- },
- registry: {
- reverse: {}
- }
- };
- }
-};
-
-function createApi (result = true) {
- const sha3 = sinon.stub().resolves('0x0000000000000000000000000000000000000000');
-
- sha3.text = sha3;
- return {
- parity: {
- registryAddress: sinon.stub().resolves('0x0000000000000000000000000000000000000000')
- },
- util: { sha3 }
- };
-}
-
-export {
- createApi,
- CONTRACT,
- STORE
-};
diff --git a/js/packages/dapp-contract/ExecuteContract/index.js b/js/packages/dapp-contract/ExecuteContract/index.js
deleted file mode 100644
index f5fcd0e52..000000000
--- a/js/packages/dapp-contract/ExecuteContract/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './executeContract';
diff --git a/js/packages/dapp-contract/Queries/index.js b/js/packages/dapp-contract/Queries/index.js
deleted file mode 100644
index 3355a7336..000000000
--- a/js/packages/dapp-contract/Queries/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './queries';
diff --git a/js/packages/dapp-contract/Queries/inputQuery.js b/js/packages/dapp-contract/Queries/inputQuery.js
deleted file mode 100644
index c89af54a9..000000000
--- a/js/packages/dapp-contract/Queries/inputQuery.js
+++ /dev/null
@@ -1,236 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { isEqual } from 'lodash';
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-import { connect } from 'react-redux';
-import { bindActionCreators } from 'redux';
-
-import { newError } from '@parity/shared/redux/actions';
-import { arrayOrObjectProptype } from '@parity/shared/util/proptypes';
-import { parseAbiType } from '@parity/shared/util/abi';
-import { Button, Container, Progress, TypedInput } from '@parity/ui';
-
-import styles from './queries.css';
-
-class InputQuery extends Component {
- static contextTypes = {
- api: PropTypes.object
- };
-
- static propTypes = {
- accountsInfo: PropTypes.object.isRequired,
- contract: PropTypes.object.isRequired,
- inputs: arrayOrObjectProptype().isRequired,
- outputs: arrayOrObjectProptype().isRequired,
- name: PropTypes.string.isRequired,
- newError: PropTypes.func.isRequired,
- signature: PropTypes.string.isRequired,
- className: PropTypes.string
- };
-
- state = {
- inputs: [],
- isValid: true,
- results: [],
- values: {}
- };
-
- componentWillMount () {
- this.parseInputs();
- }
-
- componentWillReceiveProps (nextProps) {
- const prevInputTypes = this.props.inputs.map((input) => input.type);
- const nextInputTypes = nextProps.inputs.map((input) => input.type);
-
- if (!isEqual(prevInputTypes, nextInputTypes)) {
- this.parseInputs(nextProps);
- }
- }
-
- parseInputs (props = this.props) {
- const inputs = props.inputs.map((input) => ({ ...input, parsed: parseAbiType(input.type) }));
- const values = inputs.reduce((values, input, index) => {
- values[index] = input.parsed.default;
- return values;
- }, {});
-
- this.setState({ inputs, values });
- }
-
- render () {
- const { name, className } = this.props;
-
- return (
-
-
- );
- }
-
- renderValue (value, output, key) {
- if (typeof value === 'undefined') {
- return null;
- }
-
- const { accountsInfo } = this.props;
- const { name, type } = output;
- const label = `${name ? `${name}: ` : ''}${type}`;
-
- return (
-
- );
- }
-
- _sortEntries (a, b) {
- return a.name.localeCompare(b.name);
- }
-}
diff --git a/js/packages/dapp-contract/api.js b/js/packages/dapp-contract/api.js
deleted file mode 100644
index b2e52cca0..000000000
--- a/js/packages/dapp-contract/api.js
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import Api from '@parity/api';
-
-const ethereumProvider = window.ethereum || window.parent.ethereum;
-
-if (!ethereumProvider) {
- throw new Error('Unable to locate EthereumProvider, object not attached');
-}
-
-export default new Api(ethereumProvider);
diff --git a/js/packages/dapp-contract/contract.css b/js/packages/dapp-contract/contract.css
deleted file mode 100644
index 7cc706b8b..000000000
--- a/js/packages/dapp-contract/contract.css
+++ /dev/null
@@ -1,111 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.events {
- width: 100%;
- border: none;
- border-spacing: 0;
-
- tr {
- line-height: 32px;
- vertical-align: top;
- }
-}
-
-.event {
- td {
- vertical-align: top;
- padding: 0 0.5em 1.5em;
-
- div {
- white-space: nowrap;
- }
-
- &.timestamp {
- padding-right: 1.5em;
- text-align: right;
- line-height: 1.5em;
- opacity: 0.5;
- white-space: nowrap;
- }
- }
-}
-
-.blockNumber {
- color: rgba(255, 255, 255, 0.25);
- margin-top: 1.5em;
-}
-
-.origin {
- text-align: left;
- padding-left: 32px;
- text-indent: 1em;
- color: rgba(255, 255, 255, 0.5);
- text-transform: uppercase;
- font-size: 0.9em;
-}
-
-.txhash {
- text-overflow: ellipsis;
- width: 20%;
-}
-
-.key {
- text-align: right;
- color: #aaa;
-}
-
-.mined {
-}
-
-.pending {
- opacity: 0.5;
-}
-
-.eventDetails {
-}
-
-.eventType {
-}
-
-.eventParams {
- padding-left: 2em;
-}
-
-.eventValue {
- margin-top: -16px;
-}
-
-.eventAddress {
- display: inline-block;
- position: relative;
- white-space: nowrap;
-}
-
-.eventIdentityicon {
- margin-bottom: -10px;
- margin-right: 0.5em;
-}
-
-.details {
- margin-top: -1.5em;
-
- h4 {
- text-transform: uppercase;
- margin: 1.5em 0 1em;
- }
-}
diff --git a/js/packages/dapp-contract/contract.js b/js/packages/dapp-contract/contract.js
deleted file mode 100644
index e17455ba3..000000000
--- a/js/packages/dapp-contract/contract.js
+++ /dev/null
@@ -1,548 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-import { connect } from 'react-redux';
-import { bindActionCreators } from 'redux';
-import BigNumber from 'bignumber.js';
-
-import { newError } from '@parity/shared/redux/actions';
-import { setVisibleAccounts } from '@parity/shared/redux/providers/personalActions';
-import { Actionbar, Button, Page, Portal } from '@parity/ui';
-import { CancelIcon, DeleteIcon, EditIcon, PlayIcon, VisibleIcon } from '@parity/ui/Icons';
-import Editor from '@parity/ui/Editor';
-
-import EditMeta from '@parity/dapp-account/EditMeta';
-import Header from '@parity/dapp-account/Header';
-import Delete from '@parity/dapp-address/Delete';
-
-import ExecuteContract from './ExecuteContract';
-import Events from './Events';
-import Queries from './Queries';
-
-import styles from './contract.css';
-
-class Contract extends Component {
- static contextTypes = {
- api: React.PropTypes.object.isRequired
- };
-
- static propTypes = {
- setVisibleAccounts: PropTypes.func.isRequired,
-
- accounts: PropTypes.object,
- accountsInfo: PropTypes.object,
- contracts: PropTypes.object,
- netVersion: PropTypes.string.isRequired,
- params: PropTypes.object
- };
-
- state = {
- contract: null,
- fromAddress: '',
- showDeleteDialog: false,
- showEditDialog: false,
- showExecuteDialog: false,
- showDetailsDialog: false,
- subscriptionId: -1,
- blockSubscriptionId: -1,
- allEvents: [],
- minedEvents: [],
- pendingEvents: [],
- queryValues: {},
- loadingEvents: true
- };
-
- componentDidMount () {
- const { api } = this.context;
-
- this.attachContract(this.props);
- this.setBaseAccount(this.props);
- this.setVisibleAccounts();
-
- api
- .subscribe('eth_blockNumber', this.queryContract)
- .then(blockSubscriptionId => this.setState({ blockSubscriptionId }));
- }
-
- componentWillReceiveProps (nextProps) {
- const { accounts, contracts } = nextProps;
-
- if (Object.keys(contracts).length !== Object.keys(this.props.contracts).length) {
- this.attachContract(nextProps);
- }
-
- if (Object.keys(accounts).length !== Object.keys(this.props.accounts).length) {
- this.setBaseAccount(nextProps);
- }
-
- const prevAddress = this.props.params.address;
- const nextAddress = nextProps.params.address;
-
- if (prevAddress !== nextAddress) {
- this.setVisibleAccounts(nextProps);
- }
- }
-
- componentWillUnmount () {
- const { api } = this.context;
- const { subscriptionId, blockSubscriptionId, contract } = this.state;
-
- if (blockSubscriptionId >= 0) {
- api.unsubscribe(blockSubscriptionId);
- }
-
- if (subscriptionId >= 0) {
- contract.unsubscribe(subscriptionId);
- }
-
- this.props.setVisibleAccounts([]);
- }
-
- setVisibleAccounts (props = this.props) {
- const { params, setVisibleAccounts } = props;
- const addresses = [ params.address ];
-
- setVisibleAccounts(addresses);
- }
-
- render () {
- const { accountsInfo, contracts, netVersion, params } = this.props;
- const { allEvents, contract, queryValues, loadingEvents } = this.state;
- const account = contracts[params.address];
-
- if (!account) {
- return null;
- }
-
- return (
-
- );
- }
-
- renderSortButton () {
- const { sortOrder } = this.state;
-
- return (
-
- );
- }
-
- renderSearchButton () {
- const onChange = (searchTokens, searchValues) => {
- this.setState({ searchTokens, searchValues });
- };
-
- return (
-
- );
- }
-
- renderActionbar () {
- const buttons = [
- }
- label={
-
- }
- onClick={ this.onAddContract }
- />,
- }
- label={
-
- }
- onClick={ this.onDeployContract }
- />,
- this.renderSearchButton(),
- this.renderSortButton()
- ];
-
- return (
-
- }
- buttons={ buttons }
- />
- );
- }
-
- renderAddContract () {
- const { contracts } = this.props;
- const { addContract } = this.state;
-
- if (!addContract) {
- return null;
- }
-
- return (
-
- );
- }
-
- renderDeployContract () {
- const { accounts } = this.props;
- const { deployContract } = this.state;
-
- if (!deployContract) {
- return null;
- }
-
- return (
-
- );
- }
-
- handleSortChange = (sortOrder) => {
- this.setState({ sortOrder });
- }
-
- onAddSearchToken = (token) => {
- const { searchTokens } = this.state;
- const newSearchTokens = uniq([].concat(searchTokens, token));
-
- this.setState({ searchTokens: newSearchTokens });
- }
-
- onDeployContractClose = () => {
- this.setState({ deployContract: false });
- }
-
- onDeployContract = () => {
- this.setState({ deployContract: true });
- }
-
- onAddContractClose = () => {
- this.setState({ addContract: false });
- }
-
- onAddContract = () => {
- this.setState({ addContract: true });
- }
-}
-
-function mapStateToProps (state) {
- const { accounts, contracts, hasContracts } = state.personal;
-
- return {
- accounts,
- contracts,
- hasContracts
- };
-}
-
-function mapDispatchToProps (dispatch) {
- return bindActionCreators({
- setVisibleAccounts
- }, dispatch);
-}
-
-export default connect(
- mapStateToProps,
- mapDispatchToProps
-)(Contracts);
diff --git a/js/packages/dapp-contracts/index.js b/js/packages/dapp-contracts/index.js
deleted file mode 100644
index 632ec9162..000000000
--- a/js/packages/dapp-contracts/index.js
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import ReactDOM from 'react-dom';
-import React from 'react';
-import { Route, Router, hashHistory } from 'react-router';
-
-import injectTapEventPlugin from 'react-tap-event-plugin';
-injectTapEventPlugin();
-
-import ContractInstances from '@parity/shared/contracts';
-import { initStore } from '@parity/shared/redux';
-import ContextProvider from '@parity/ui/ContextProvider';
-
-import api from './api';
-import Contracts from './contracts';
-
-ContractInstances.get(api);
-
-const store = initStore(api, hashHistory);
-
-ReactDOM.render(
-
-
-
-
- ,
- document.querySelector('#container')
-);
diff --git a/js/packages/dapp-contracts/package.json b/js/packages/dapp-contracts/package.json
deleted file mode 100644
index cd0f93c8f..000000000
--- a/js/packages/dapp-contracts/package.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "name": "@parity/dapp-contracts",
- "description": "Parity contracts views",
- "version": "1.99.99",
- "main": "index.js",
- "author": "Parity Team ",
- "maintainers": [],
- "contributors": [],
- "license": "GPL-3.0",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/paritytech/dapp-contracts.git"
- },
- "keywords": [],
- "scripts": {},
- "devDependencies": {},
- "dependencies": {},
- "peerDependencies": {}
-}
diff --git a/js/packages/dapp-dappAccounts/api.js b/js/packages/dapp-dappAccounts/api.js
deleted file mode 100644
index b2e52cca0..000000000
--- a/js/packages/dapp-dappAccounts/api.js
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import Api from '@parity/api';
-
-const ethereumProvider = window.ethereum || window.parent.ethereum;
-
-if (!ethereumProvider) {
- throw new Error('Unable to locate EthereumProvider, object not attached');
-}
-
-export default new Api(ethereumProvider);
diff --git a/js/packages/dapp-dappAccounts/dappAccounts.js b/js/packages/dapp-dappAccounts/dappAccounts.js
deleted file mode 100644
index 2381a666c..000000000
--- a/js/packages/dapp-dappAccounts/dappAccounts.js
+++ /dev/null
@@ -1,70 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { observer } from 'mobx-react';
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-
-import { AccountCard, Page, SelectionList } from '@parity/ui';
-
-import Store from './store';
-
-@observer
-export default class DappAccounts extends Component {
- static contextTypes = {
- api: PropTypes.object.isRequired
- };
-
- store = new Store(this.context.api);
-
- render () {
- return (
-
- }
- >
-
-
- );
- }
-
- onMakeDefault = (account) => {
- this.store.setDefaultAccount(account.address);
- }
-
- onSelect = (account) => {
- this.store.selectAccount(account.address);
- }
-
- renderAccount = (account) => {
- return (
-
- );
- }
-}
diff --git a/js/packages/dapp-dappAccounts/index.js b/js/packages/dapp-dappAccounts/index.js
deleted file mode 100644
index 39fdb1972..000000000
--- a/js/packages/dapp-dappAccounts/index.js
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import ReactDOM from 'react-dom';
-import React from 'react';
-import { Route, Router, hashHistory } from 'react-router';
-
-import injectTapEventPlugin from 'react-tap-event-plugin';
-injectTapEventPlugin();
-
-import { initStore } from '@parity/shared/redux';
-import ContextProvider from '@parity/ui/ContextProvider';
-
-import api from './api';
-import DappAccounts from './dappAccounts';
-
-const store = initStore(api, hashHistory);
-
-ReactDOM.render(
-
-
-
-
- ,
- document.querySelector('#container')
-);
diff --git a/js/packages/dapp-dappAccounts/package.json b/js/packages/dapp-dappAccounts/package.json
deleted file mode 100644
index 901d04a79..000000000
--- a/js/packages/dapp-dappAccounts/package.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "name": "@parity/dapp-dappaccounts",
- "description": "Parity default accounts selection",
- "version": "1.99.99",
- "main": "index.js",
- "author": "Parity Team ",
- "maintainers": [],
- "contributors": [],
- "license": "GPL-3.0",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/paritytech/dapp-dappaccounts.git"
- },
- "keywords": [],
- "scripts": {},
- "devDependencies": {},
- "dependencies": {},
- "peerDependencies": {}
-}
diff --git a/js/packages/dapp-dappAccounts/store.js b/js/packages/dapp-dappAccounts/store.js
deleted file mode 100644
index c801a652d..000000000
--- a/js/packages/dapp-dappAccounts/store.js
+++ /dev/null
@@ -1,149 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { action, observable, transaction } from 'mobx';
-
-export default class Store {
- @observable accounts = [];
- @observable modalOpen = false;
- @observable whitelist = [];
- @observable whitelistDefault = null;
-
- constructor (api) {
- this._api = api;
-
- this.load();
- }
-
- save = () => {
- const checkedAccounts = this.accounts.filter((account) => account.checked);
- const defaultAddress = (this.accounts.find((account) => account.default) || {}).address;
- const addresses = checkedAccounts.length === this.accounts.length
- ? null
- : checkedAccounts.map((account) => account.address);
-
- this.updateWhitelist(addresses, defaultAddress);
- }
-
- // FIXME: Hardware accounts are not showing up here
- @action setAccounts = (accounts) => {
- transaction(() => {
- this.accounts = Object
- .keys(accounts)
- .filter((address) => {
- const account = accounts[address];
-
- if (account.uuid) {
- return true;
- } else if (account.meta.hardware) {
- account.hardware = true;
- return true;
- } else if (account.meta.external) {
- account.external = true;
- return true;
- }
-
- return false;
- })
- .map((address, index) => {
- const account = accounts[address];
-
- return {
- address,
- checked: this.whitelist
- ? this.whitelist.includes(address)
- : true,
- default: this.whitelistDefault
- ? this.whitelistDefault === address
- : index === 0,
- description: account.meta.description,
- name: account.name
- };
- });
- });
- }
-
- @action selectAccount = (address) => {
- transaction(() => {
- const isSingleAccount = this.accounts.filter((account) => account.checked).length === 1;
-
- this.accounts = this.accounts.map((account) => {
- if (account.address === address && (!isSingleAccount || !account.checked)) {
- account.checked = !account.checked;
- account.default = false;
- }
-
- return account;
- });
-
- this.setDefaultAccount((
- this.accounts.find((account) => account.default) ||
- this.accounts.find((account) => account.checked) ||
- {}
- ).address);
- });
- }
-
- @action setDefaultAccount = (address) => {
- this.accounts = this.accounts.map((account) => {
- if (account.address === address) {
- account.checked = true;
- account.default = true;
- } else if (account.default) {
- account.default = false;
- }
-
- return account;
- });
- }
-
- @action setWhitelist = (whitelist, whitelistDefault) => {
- transaction(() => {
- this.whitelist = whitelist;
- this.whitelistDefault = whitelistDefault;
- });
- }
-
- load () {
- return Promise
- .all([
- this._api.parity.allAccountsInfo(),
- this._api.parity.getNewDappsAddresses(),
- this._api.parity.getNewDappsDefaultAddress()
- ])
- .then(([accounts, whitelist, whitelistDefault]) => {
- this.setWhitelist(whitelist, whitelistDefault);
- this.setAccounts(accounts);
- })
- .catch((error) => {
- console.warn('load', error);
- });
- }
-
- updateWhitelist (whitelist, whitelistDefault = null) {
- return Promise
- .all([
- this._api.parity.setNewDappsAddresses(whitelist),
- this._api.parity.setNewDappsDefaultAddress(whitelistDefault)
- ])
- .then(() => {
- this.setWhitelist(whitelist, whitelistDefault);
- })
- .catch((error) => {
- console.warn('updateWhitelist', error);
- });
- }
-}
diff --git a/js/packages/dapp-dappMethods/MethodCheck/index.js b/js/packages/dapp-dappMethods/MethodCheck/index.js
deleted file mode 100644
index d34a3efb8..000000000
--- a/js/packages/dapp-dappMethods/MethodCheck/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './methodCheck';
diff --git a/js/packages/dapp-dappMethods/MethodCheck/methodCheck.js b/js/packages/dapp-dappMethods/MethodCheck/methodCheck.js
deleted file mode 100644
index 3c036d3a7..000000000
--- a/js/packages/dapp-dappMethods/MethodCheck/methodCheck.js
+++ /dev/null
@@ -1,41 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React from 'react';
-import PropTypes from 'prop-types';
-
-import { CheckboxTickedIcon, CheckboxUntickedIcon } from '@parity/ui/Icons';
-
-export default function MethodCheck ({ checked, dappId, method, onToggle }) {
- const _onClick = () => onToggle(method, dappId);
-
- return (
-
- {
- checked
- ?
- :
- }
-
- );
-}
-
-MethodCheck.propTypes = {
- checked: PropTypes.bool.isRequired,
- dappId: PropTypes.string.isRequired,
- method: PropTypes.string.isRequired,
- onToggle: PropTypes.func.isRequired
-};
diff --git a/js/packages/dapp-dappMethods/api.js b/js/packages/dapp-dappMethods/api.js
deleted file mode 100644
index b2e52cca0..000000000
--- a/js/packages/dapp-dappMethods/api.js
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import Api from '@parity/api';
-
-const ethereumProvider = window.ethereum || window.parent.ethereum;
-
-if (!ethereumProvider) {
- throw new Error('Unable to locate EthereumProvider, object not attached');
-}
-
-export default new Api(ethereumProvider);
diff --git a/js/packages/dapp-dappMethods/dappMethods.css b/js/packages/dapp-dappMethods/dappMethods.css
deleted file mode 100644
index 36afd036f..000000000
--- a/js/packages/dapp-dappMethods/dappMethods.css
+++ /dev/null
@@ -1,47 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-$border: 1px solid #ccc;
-
-.body {
- td {
- border-bottom: $border;
- border-right: $border;
- padding: 0.25em;
- vertical-align: center;
-
- &.check {
- cursor: pointer;
- font-size: 1.5em;
- }
- }
-
- th {
- height: 140px;
- white-space: nowrap;
-
- > div {
- transform: translate(25px, 51px) rotate(315deg);
- width: 30px;
-
- > span {
- border-bottom: $border;
- padding: 5px 10px;
- }
- }
- }
-}
diff --git a/js/packages/dapp-dappMethods/dappMethods.js b/js/packages/dapp-dappMethods/dappMethods.js
deleted file mode 100644
index 84c04c530..000000000
--- a/js/packages/dapp-dappMethods/dappMethods.js
+++ /dev/null
@@ -1,91 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { observer } from 'mobx-react';
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-
-import { Page } from '@parity/ui';
-
-import Store from './store';
-
-import MethodCheck from './MethodCheck';
-import styles from './dappMethods.css';
-
-@observer
-export default class SelectMethods extends Component {
- static contextTypes = {
- api: PropTypes.object.isRequired
- };
-
- store = new Store(this.context.api);
-
- render () {
- return (
-
- }
- >
-
-
- );
- }
-}
diff --git a/js/packages/dapp-dappMethods/index.js b/js/packages/dapp-dappMethods/index.js
deleted file mode 100644
index dee1b60b6..000000000
--- a/js/packages/dapp-dappMethods/index.js
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import ReactDOM from 'react-dom';
-import React from 'react';
-import { Route, Router, hashHistory } from 'react-router';
-
-import injectTapEventPlugin from 'react-tap-event-plugin';
-injectTapEventPlugin();
-
-import ContractInstances from '@parity/shared/contracts';
-import { initStore } from '@parity/shared/redux';
-import ContextProvider from '@parity/ui/ContextProvider';
-
-import api from './api';
-import DappMethods from './dappMethods';
-
-ContractInstances.get(api);
-
-const store = initStore(api, hashHistory);
-
-ReactDOM.render(
-
-
-
-
- ,
- document.querySelector('#container')
-);
diff --git a/js/packages/dapp-dappMethods/package.json b/js/packages/dapp-dappMethods/package.json
deleted file mode 100644
index 168b4bb3a..000000000
--- a/js/packages/dapp-dappMethods/package.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "name": "@parity/dapp-dappmethods",
- "description": "Parity default dapp method selection",
- "version": "1.99.99",
- "main": "index.js",
- "author": "Parity Team ",
- "maintainers": [],
- "contributors": [],
- "license": "GPL-3.0",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/paritytech/dapp-dappmethods.git"
- },
- "keywords": [],
- "scripts": {},
- "devDependencies": {},
- "dependencies": {},
- "peerDependencies": {}
-}
diff --git a/js/packages/dapp-dappMethods/store.js b/js/packages/dapp-dappMethods/store.js
deleted file mode 100644
index c74b4d869..000000000
--- a/js/packages/dapp-dappMethods/store.js
+++ /dev/null
@@ -1,73 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { action, observable } from 'mobx';
-
-export default class Store {
- @observable apps= [];
- @observable methods = [];
- @observable permissions = {};
-
- constructor (api) {
- this._api = api;
-
- this.loadInitialise();
- }
-
- @action setApps = (apps) => {
- this.apps = apps;
- }
-
- @action setMethods = (methods) => {
- this.methods = methods;
- }
-
- @action setPermissions = (permissions) => {
- this.permissions = permissions;
- }
-
- @action toggleAppPermission = (method, appId) => {
- const id = `${method}:${appId}`;
-
- this.permissions = Object.assign({}, this.permissions, {
- [id]: !this.permissions[id]
- });
-
- this.savePermissions();
- }
-
- hasAppPermission = (method, appId) => {
- return this.permissions[`${method}:${appId}`] || false;
- }
-
- loadInitialise = () => {
- return Promise
- .all([
- this._api.shell.getApps(false),
- this._api.shell.getFilteredMethods(),
- this._api.shell.getMethodPermissions()
- ])
- .then(([apps, methods, permissions]) => {
- this.setApps(apps);
- this.setMethods(methods);
- this.setPermissions(permissions);
- });
- }
-
- savePermissions = () => {
- this._api.shell.setMethodPermissions(this.permissions);
- }
-}
diff --git a/js/packages/dapp-dappVisible/api.js b/js/packages/dapp-dappVisible/api.js
deleted file mode 100644
index b2e52cca0..000000000
--- a/js/packages/dapp-dappVisible/api.js
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import Api from '@parity/api';
-
-const ethereumProvider = window.ethereum || window.parent.ethereum;
-
-if (!ethereumProvider) {
- throw new Error('Unable to locate EthereumProvider, object not attached');
-}
-
-export default new Api(ethereumProvider);
diff --git a/js/packages/dapp-dappVisible/dappVisible.css b/js/packages/dapp-dappVisible/dappVisible.css
deleted file mode 100644
index 2c8779a84..000000000
--- a/js/packages/dapp-dappVisible/dappVisible.css
+++ /dev/null
@@ -1,47 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.modal {
- flex-direction: column;
-}
-
-.description {
- margin-top: .5em !important;
-}
-
-.list {
- margin-bottom: 1.5em;
-
- &:last-child {
- margin-bottom: 0;
- }
-
- .background {
- padding: 0.5em 0;
- }
-
- .header {
- text-transform: uppercase;
- }
-
- .byline {
- font-size: 0.75em;
- padding-top: 0.5em;
- line-height: 1.5em;
- opacity: 0.75;
- }
-}
diff --git a/js/packages/dapp-dappVisible/dappVisible.js b/js/packages/dapp-dappVisible/dappVisible.js
deleted file mode 100644
index b772bb83c..000000000
--- a/js/packages/dapp-dappVisible/dappVisible.js
+++ /dev/null
@@ -1,128 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { observer } from 'mobx-react';
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-
-import { DappCard, Page, SelectionList } from '@parity/ui';
-
-import Store from './store';
-import styles from './dappVisible.css';
-
-@observer
-export default class DappVisible extends Component {
- static contextTypes = {
- api: PropTypes.object.isRequired
- };
-
- store = new Store(this.context.api);
-
- render () {
- return (
-
- }
- >
-
- {
- this.renderList(this.store.sortedLocal, this.store.displayApps,
- ,
-
- )
- }
- {
- this.renderList(this.store.sortedBuiltin, this.store.displayApps,
- ,
-
- )
- }
- {
- this.renderList(this.store.sortedNetwork, this.store.displayApps,
- ,
-
- )
- }
-
- );
- }
-
- renderList (items, visibleItems, header, byline) {
- if (!items || !items.length) {
- return null;
- }
-
- return (
-
-
-
{ header }
-
{ byline }
-
-
-
- );
- }
-
- renderApp = (app) => {
- return (
-
- );
- }
-
- isVisible = (app) => {
- return (this.store.displayApps[app.id] && this.store.displayApps[app.id].visible) || false;
- }
-
- onSelect = (app) => {
- if (this.isVisible(app)) {
- this.store.hideApp(app.id);
- } else {
- this.store.showApp(app.id);
- }
- }
-}
diff --git a/js/packages/dapp-dappVisible/index.js b/js/packages/dapp-dappVisible/index.js
deleted file mode 100644
index f90151bfa..000000000
--- a/js/packages/dapp-dappVisible/index.js
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import ReactDOM from 'react-dom';
-import React from 'react';
-import { Route, Router, hashHistory } from 'react-router';
-
-import injectTapEventPlugin from 'react-tap-event-plugin';
-injectTapEventPlugin();
-
-import { initStore } from '@parity/shared/redux';
-import ContextProvider from '@parity/ui/ContextProvider';
-
-import api from './api';
-import DappVisible from './dappVisible';
-
-const store = initStore(api, hashHistory);
-
-ReactDOM.render(
-
-
-
-
- ,
- document.querySelector('#container')
-);
diff --git a/js/packages/dapp-dappVisible/package.json b/js/packages/dapp-dappVisible/package.json
deleted file mode 100644
index 2ebfdf0b5..000000000
--- a/js/packages/dapp-dappVisible/package.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "name": "@parity/dapp-dappvisible",
- "description": "Parity default dapp visibility selection",
- "version": "1.99.99",
- "main": "index.js",
- "author": "Parity Team ",
- "maintainers": [],
- "contributors": [],
- "license": "GPL-3.0",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/paritytech/dapp-dappvisible.git"
- },
- "keywords": [],
- "scripts": {},
- "devDependencies": {},
- "dependencies": {},
- "peerDependencies": {}
-}
diff --git a/js/packages/dapp-dappVisible/store.js b/js/packages/dapp-dappVisible/store.js
deleted file mode 100644
index 0c4b2b9ef..000000000
--- a/js/packages/dapp-dappVisible/store.js
+++ /dev/null
@@ -1,101 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { action, computed, observable } from 'mobx';
-
-export default class DappsStore {
- @observable apps = [];
- @observable displayApps = {};
-
- _api = null;
-
- constructor (api) {
- this._api = api;
-
- this.loadApps();
- }
-
- @computed get sortedBuiltin () {
- return this.apps.filter((app) => app.type === 'builtin');
- }
-
- @computed get sortedLocal () {
- return this.apps.filter((app) => app.type === 'local');
- }
-
- @computed get sortedNetwork () {
- return this.apps.filter((app) => app.type === 'network');
- }
-
- @computed get visibleApps () {
- return this.apps.filter((app) => this.displayApps[app.id] && this.displayApps[app.id].visible);
- }
-
- @computed get visibleBuiltin () {
- return this.visibleApps.filter((app) => !app.noselect && app.type === 'builtin');
- }
-
- @computed get visibleLocal () {
- return this.visibleApps.filter((app) => app.type === 'local');
- }
-
- @computed get visibleNetwork () {
- return this.visibleApps.filter((app) => app.type === 'network');
- }
-
- @computed get visibleViews () {
- return this.visibleApps.filter((app) => !app.noselect && app.type === 'view');
- }
-
- @action setApps = (apps) => {
- this.apps = apps;
- }
-
- @action setDisplayApps = (displayApps) => {
- this.displayApps = Object.assign({}, this.displayApps, displayApps);
- };
-
- @action hideApp = (id) => {
- this.setDisplayApps({ [id]: { visible: false } });
- this._api.shell.setAppVisibility(id, false);
- }
-
- @action showApp = (id) => {
- this.setDisplayApps({ [id]: { visible: true } });
- this._api.shell.setAppVisibility(id, true);
- }
-
- getAppById = (id) => {
- return this.apps.find((app) => app.id === id);
- }
-
- loadApps () {
- return Promise
- .all([
- this._api.shell.getApps(true),
- this._api.shell.getApps(false)
- ])
- .then(([all, displayed]) => {
- this.setDisplayApps(
- displayed.reduce((result, { id }) => {
- result[id] = { visible: true };
- return result;
- }, {})
- );
- this.setApps(all);
- });
- }
-}
diff --git a/js/packages/dapp-dappreg/Application/application.css b/js/packages/dapp-dappreg/Application/application.css
deleted file mode 100644
index c6057e8cc..000000000
--- a/js/packages/dapp-dappreg/Application/application.css
+++ /dev/null
@@ -1,59 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-@import '../_colors.css';
-
-.body {
- color: $text-color;
- background: $background-color;
- padding: 3em 0 6em;
- text-align: center;
-}
-
-.apps {
- background: white;
- border-radius: 0.5em;
- margin: 0 auto;
- max-width: 980px;
- padding: 1.5em;
- text-align: left;
-}
-
-.footer {
- font-size: 0.75em;
- margin: 1em;
- padding: 1.5em;
- text-align: center;
-}
-
-.header {
- background: $blue;
- color: white;
- left: 0;
- padding: 1em;
- position: fixed;
- right: 0;
- top: 0;
- z-index: 25;
-}
-
-.loading {
- text-align: center;
- padding-top: 5em;
- font-size: 2em;
- color: $loading-color;
-}
diff --git a/js/packages/dapp-dappreg/Application/application.js b/js/packages/dapp-dappreg/Application/application.js
deleted file mode 100644
index b33aa0b96..000000000
--- a/js/packages/dapp-dappreg/Application/application.js
+++ /dev/null
@@ -1,69 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import { observer } from 'mobx-react';
-
-import DappsStore from '../dappsStore';
-
-import Dapps from '../Dapps';
-import Transactions from '../Transactions';
-import Warning from '../Warning';
-import styles from './application.css';
-
-@observer
-export default class Application extends Component {
- dappsStore = DappsStore.get();
-
- render () {
- if (this.dappsStore.isLoading) {
- return (
-
- DAPP REGISTRY, a global view of decentralized applications available on the network. Putting the puzzle together.
-
-
-
-
-
-
-
-
- { this.dappsStore.count } applications registered, { this.dappsStore.ownedCount } owned by user
-
-
-
-
-
- );
- }
-}
diff --git a/js/packages/dapp-dappreg/Application/index.js b/js/packages/dapp-dappreg/Application/index.js
deleted file mode 100644
index 3d8d1ca3b..000000000
--- a/js/packages/dapp-dappreg/Application/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './application';
diff --git a/js/packages/dapp-dappreg/Button/button.css b/js/packages/dapp-dappreg/Button/button.css
deleted file mode 100644
index aa70e1b1b..000000000
--- a/js/packages/dapp-dappreg/Button/button.css
+++ /dev/null
@@ -1,45 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-@import '../_colors.css';
-@import '../_utils.css';
-
-.button {
- background: $blue;
- border: none;
- border-radius: 0.25em;
- color: white;
- cursor: pointer;
- font-size: 1em;
- margin: 1em 0.375em;
- opacity: 0.85;
- padding: 0.75em 2em;
-
- &[disabled] {
- opacity: 0.5;
- cursor: default;
- background: $disabled-bg;
- }
-
- &[data-warning="true"] {
- background: $warning-bg;
- }
-
- &:focus {
- transform: scale(1.05);
- }
-}
diff --git a/js/packages/dapp-dappreg/Button/button.js b/js/packages/dapp-dappreg/Button/button.js
deleted file mode 100644
index deedd8473..000000000
--- a/js/packages/dapp-dappreg/Button/button.js
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-
-import styles from './button.css';
-
-export default class Button extends Component {
- static propTypes = {
- className: PropTypes.string,
- disabled: PropTypes.bool,
- label: PropTypes.string.isRequired,
- warning: PropTypes.bool,
- onClick: PropTypes.func
- }
-
- render () {
- const { className, disabled, label, warning } = this.props;
- const classes = [ styles.button, className ];
-
- return (
-
- );
- }
-
- handleClick = (event) => {
- if (this.props.disabled) {
- event.preventDefault();
- event.stopPropagation();
- return;
- }
-
- this.props.onClick(event);
- }
-}
diff --git a/js/packages/dapp-dappreg/Button/index.js b/js/packages/dapp-dappreg/Button/index.js
deleted file mode 100644
index 0c2be07ee..000000000
--- a/js/packages/dapp-dappreg/Button/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './button';
diff --git a/js/packages/dapp-dappreg/Card/card.css b/js/packages/dapp-dappreg/Card/card.css
deleted file mode 100644
index 4acad9f50..000000000
--- a/js/packages/dapp-dappreg/Card/card.css
+++ /dev/null
@@ -1,64 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-@import '../_utils.css';
-
-$imgSize: 6rem;
-
-.container {
- display: flex;
-}
-
-.card {
- align-items: center;
- background-color: rgba(240, 240, 240, 0.75);
- display: flex;
- flex-direction: column;
- margin: 1rem;
- padding: 1rem;
- width: 10rem;
-
- &:hover,
- &:focus {
- cursor: pointer;
- transform: scale(1.05);
- }
-}
-
-.dashed {
- border: 1px dashed black;
-}
-
-.icon {
- margin-bottom: 0.75rem;
- overflow: hidden;
-
- img {
- border-radius: 50%;
- height: $imgSize;
- width: $imgSize;
- }
-}
-
-.name {
- font-size: 1.25rem;
- margin-bottom: 0.5rem;
- overflow: hidden;
- text-align: center;
- text-overflow: ellipsis;
- width: 100%;
-}
diff --git a/js/packages/dapp-dappreg/Card/card.js b/js/packages/dapp-dappreg/Card/card.js
deleted file mode 100644
index 1b85aca89..000000000
--- a/js/packages/dapp-dappreg/Card/card.js
+++ /dev/null
@@ -1,100 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import keycode from 'keycode';
-import React, { Component } from 'react';
-import ReactDOM from 'react-dom';
-import PropTypes from 'prop-types';
-
-import styles from './card.css';
-
-export default class Card extends Component {
- static propTypes = {
- children: PropTypes.any,
- dashed: PropTypes.bool,
- focus: PropTypes.bool,
- icon: PropTypes.object,
- name: PropTypes.object,
- onClick: PropTypes.func.isRequired
- };
-
- static defaultProps = {
- dashed: false,
- focus: false,
- name: { value: '' }
- };
-
- componentWillReceiveProps (nextProps) {
- if (nextProps.focus && !this.props.focus) {
- this.handleFocus();
- }
- }
-
- render () {
- const { children, dashed, icon, name } = this.props;
-
- const cardClasses = [ styles.card ];
-
- if (dashed) {
- cardClasses.push(styles.dashed);
- }
-
- return (
-
-
-
- { icon }
-
-
- { name.value }
-
- { children }
-
-
- );
- }
-
- handleKeyPress = (event) => {
- const codeName = keycode(event);
-
- if (codeName === 'enter') {
- return this.handleClick();
- }
-
- return event;
- }
-
- handleFocus = () => {
- setTimeout(() => {
- const element = ReactDOM.findDOMNode(this.refs.card);
-
- element && element.focus();
- }, 50);
- }
-
- handleClick = () => {
- this.props.onClick();
- }
-}
diff --git a/js/packages/dapp-dappreg/Card/index.js b/js/packages/dapp-dappreg/Card/index.js
deleted file mode 100644
index 30b585806..000000000
--- a/js/packages/dapp-dappreg/Card/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './card';
diff --git a/js/packages/dapp-dappreg/CreateDappCard/createDappCard.js b/js/packages/dapp-dappreg/CreateDappCard/createDappCard.js
deleted file mode 100644
index 39c689fc2..000000000
--- a/js/packages/dapp-dappreg/CreateDappCard/createDappCard.js
+++ /dev/null
@@ -1,84 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-
-import DappsStore from '../dappsStore';
-import Card from '../Card';
-import ModalRegister from '../ModalRegister';
-
-import PlusImage from '@parity/shared/assets/images/dapps/plus.svg';
-
-export default class CreateDappCard extends Component {
- state = {
- dappId: null,
- focus: false,
- open: false
- };
-
- dappsStore = DappsStore.get();
-
- render () {
- const { focus } = this.state;
-
- return (
-
- );
- }
-
- renderModal () {
- const { dappId, open } = this.state;
-
- if (!open) {
- return null;
- }
-
- return (
-
- );
- }
-
- handleOpen = () => {
- const dappId = this.dappsStore.createDappId();
-
- this.setState({ focus: false, open: true, dappId });
- }
-
- handleClose = () => {
- this.setState({ focus: true, open: false, dappId: null });
- }
-
- handleRegister = () => {
- const { dappId } = this.state;
-
- this.dappsStore.register(dappId);
- this.handleClose();
- }
-}
diff --git a/js/packages/dapp-dappreg/CreateDappCard/index.js b/js/packages/dapp-dappreg/CreateDappCard/index.js
deleted file mode 100644
index 4181f8dcc..000000000
--- a/js/packages/dapp-dappreg/CreateDappCard/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './createDappCard';
diff --git a/js/packages/dapp-dappreg/DappCard/dappCard.css b/js/packages/dapp-dappreg/DappCard/dappCard.css
deleted file mode 100644
index ed4b483ae..000000000
--- a/js/packages/dapp-dappreg/DappCard/dappCard.css
+++ /dev/null
@@ -1,22 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.author,
-.version {
- font-size: 0.75rem;
- text-align: center;
-}
diff --git a/js/packages/dapp-dappreg/DappCard/dappCard.js b/js/packages/dapp-dappreg/DappCard/dappCard.js
deleted file mode 100644
index 76240829e..000000000
--- a/js/packages/dapp-dappreg/DappCard/dappCard.js
+++ /dev/null
@@ -1,111 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-
-import Card from '../Card';
-import DappsStore from '../dappsStore';
-import DappModal from '../DappModal';
-
-import styles from './dappCard.css';
-
-export default class DappCard extends Component {
- dappsStore = DappsStore.get();
-
- static propTypes = {
- dapp: PropTypes.object.isRequired
- };
-
- state = {
- focus: false,
- open: false
- };
-
- render () {
- const { dapp } = this.props;
- const { focus } = this.state;
- const { id, image } = dapp;
- const manifest = dapp.manifest.content;
-
- return (
-
- );
- }
-
- renderModal () {
- const { dapp } = this.props;
- const { open } = this.state;
-
- return (
-
- );
- }
-
- renderImage (url) {
- return (
-
- );
- }
-
- renderVersion (manifest) {
- if (!manifest || !manifest.version) {
- return null;
- }
-
- return (
-
- v{ manifest.version }
-
- );
- }
-
- renderAuthor (manifest) {
- if (!manifest || !manifest.author) {
- return null;
- }
-
- return (
-
- by { manifest && manifest.author }
-
- );
- }
-
- handleClose = () => {
- this.setState({ focus: true, open: false });
- }
-
- handleOpen = () => {
- this.setState({ focus: false, open: true });
- }
-}
diff --git a/js/packages/dapp-dappreg/DappCard/index.js b/js/packages/dapp-dappreg/DappCard/index.js
deleted file mode 100644
index eed38ca78..000000000
--- a/js/packages/dapp-dappreg/DappCard/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './dappCard';
diff --git a/js/packages/dapp-dappreg/DappModal/dappModal.css b/js/packages/dapp-dappreg/DappModal/dappModal.css
deleted file mode 100644
index 5b7e18f9b..000000000
--- a/js/packages/dapp-dappreg/DappModal/dappModal.css
+++ /dev/null
@@ -1,82 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-@import '../_colors.css';
-@import '../_utils.css';
-
-$imgSize: 5rem;
-
-.code {
- color: $code-color;
- font-family: 'Roboto Mono', monospace;
- margin-top: 1rem;
-
- .codeTitle {
- align-items: center;
- background-color: $code-title-bg;
- color: $code-title-color;
- display: inline-flex;
- height: 2rem;
- padding: 0 0.5rem;
- }
-
- .codeContainer {
- background-color: $code-bg;
- padding: 0.5rem 1rem;
- }
-
- code {
- font-size: 0.75rem;
- white-space: pre-wrap;
- }
-}
-
-.actions {
- height: 0.5rem;
- position: relative;
- text-align: right;
- top: 0.5rem;
-
- .button {
- margin-bottom: 0;
- margin-top: 0;
- padding: 0.5rem 1.5rem;
- }
-}
-
-.icon {
- margin-right: 1.5rem;
- overflow: hidden;
-
- img {
- border: 2px solid #ddd;
- border-radius: 50%;
- height: $imgSize;
- width: $imgSize;
- }
-}
-
-.name {
- font-size: 1.25rem;
- margin-bottom: 0.25rem;
-}
-
-.info {
- color: #ddd;
- font-size: 0.75rem;
- margin-top: 0.25rem;
-}
diff --git a/js/packages/dapp-dappreg/DappModal/dappModal.js b/js/packages/dapp-dappreg/DappModal/dappModal.js
deleted file mode 100644
index 5cee744fb..000000000
--- a/js/packages/dapp-dappreg/DappModal/dappModal.js
+++ /dev/null
@@ -1,424 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { observer } from 'mobx-react';
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-
-import { api } from '../parity';
-import DappsStore from '../dappsStore';
-import Button from '../Button';
-import Input from '../Input';
-import Modal from '../Modal';
-import ModalDelete from '../ModalDelete';
-import ModalUpdate from '../ModalUpdate';
-import SelectAccount from '../SelectAccount';
-
-import styles from './dappModal.css';
-
-@observer
-export default class DappModal extends Component {
- static propTypes = {
- dapp: PropTypes.object.isRequired,
- open: PropTypes.bool.isRequired,
- onClose: PropTypes.func.isRequired
- };
-
- state = {
- showDelete: false,
- showUpdate: false,
- updates: null,
- updating: false
- };
-
- dappsStore = DappsStore.get();
-
- render () {
- const { dapp, open } = this.props;
- const { showDelete, showUpdate, updates } = this.state;
-
- if (!open) {
- return null;
- }
-
- return (
-
- );
- }
-
- renderAddDapp () {
- const { own } = this.props;
-
- if (!own) {
- return null;
- }
-
- return (
-
- );
- }
-
- renderDapps (dapps) {
- return dapps.map((dapp) => {
- const { id } = dapp;
-
- return (
-
- );
- });
- }
-}
diff --git a/js/packages/dapp-dappreg/Dapps/index.js b/js/packages/dapp-dappreg/Dapps/index.js
deleted file mode 100644
index 9e6dddb63..000000000
--- a/js/packages/dapp-dappreg/Dapps/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './dapps';
diff --git a/js/packages/dapp-dappreg/Input/index.js b/js/packages/dapp-dappreg/Input/index.js
deleted file mode 100644
index 29e00f72b..000000000
--- a/js/packages/dapp-dappreg/Input/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './input';
diff --git a/js/packages/dapp-dappreg/Input/input.css b/js/packages/dapp-dappreg/Input/input.css
deleted file mode 100644
index c553387a6..000000000
--- a/js/packages/dapp-dappreg/Input/input.css
+++ /dev/null
@@ -1,96 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.input {
- position: relative;
-
- input, select {
- background: rgba(255, 255, 255, 0.85);
- border: 4px solid rgba(223, 223, 223, 0.85);
- border-radius: 0.25em;
- box-sizing: border-box;
- color: #333;
- font-size: 1em;
- margin: 0.25em 0 0.25em 0;
- padding: 0.5em 0.5em 1.5em 0.5em;
- width: 100%;
- }
-
- &.withOverlay input {
- padding-right: 3em;
- }
-
- input {
- padding-bottom: 1.5em;
-
- &[data-dirty="true"] {
- background: rgba(255, 255, 203, 0.85);
- border-color: rgba(203, 203, 151, 0.85);
- }
-
- &[data-error="true"] {
- background: rgba(255, 223, 223, 0.85) !important;
- border-color: rgba(223, 191, 191, 0.85) !important;
- }
-
- &[readonly] {
- background: rgba(239, 239, 239, 0.85);
- border-color: rgba(223, 223, 223, 0.85);
- }
- }
-
- label {
- color: #888;
- display: block;
- font-size: 0.75em;
- margin-top: 1.5em;
- }
-
- select {
- -moz-appearance: none;
- -webkit-appearance: none;
- appearance: none;
- height: 58px;
-
- &[disabled] {
- background: rgba(239, 239, 239, 0.85);
- border-color: rgba(223, 223, 223, 0.85);
- }
- }
-
- .hint {
- color: #888;
- display: block;
- font-size: 0.75em;
- position: absolute;
- right: 52px;
- text-align: right;
- top: 52px;
- }
-
- .overlay {
- right: 10px;
- position: absolute;
- top: 30px;
-
- img {
- border-radius: 50%;
- height: 32px;
- width: 32px;
- }
- }
-}
diff --git a/js/packages/dapp-dappreg/Input/input.js b/js/packages/dapp-dappreg/Input/input.js
deleted file mode 100644
index 5071e386d..000000000
--- a/js/packages/dapp-dappreg/Input/input.js
+++ /dev/null
@@ -1,54 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-
-import styles from './input.css';
-
-export default class Input extends Component {
- static propTypes = {
- children: PropTypes.node.isRequired,
- hint: PropTypes.string,
- label: PropTypes.string.isRequired,
- overlay: PropTypes.node
- }
-
- render () {
- const { children, hint, label, overlay } = this.props;
-
- const inputClasses = [ styles.input ];
-
- if (overlay) {
- inputClasses.push(styles.withOverlay);
- }
-
- return (
-
-
- { children }
-
- { hint }
-
-
- { overlay }
-
-
- );
- }
-}
diff --git a/js/packages/dapp-dappreg/Modal/index.js b/js/packages/dapp-dappreg/Modal/index.js
deleted file mode 100644
index 7e9d10c91..000000000
--- a/js/packages/dapp-dappreg/Modal/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './modal';
diff --git a/js/packages/dapp-dappreg/Modal/modal.css b/js/packages/dapp-dappreg/Modal/modal.css
deleted file mode 100644
index 2c24d5ba4..000000000
--- a/js/packages/dapp-dappreg/Modal/modal.css
+++ /dev/null
@@ -1,137 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-@import '../_colors.css';
-@import '../_utils.css';
-
-.modal {
- align-items: center;
- background-color: $modal-bg;
- bottom: 0;
- display: flex;
- justify-content: center;
- left: 0;
- position: fixed;
- right: 0;
- top: 0;
- z-index: 150;
-
- &.secondary {
- align-items: flex-start;
- z-index: 200;
-
- .content {
- line-height: 1.5rem;
- padding: 2rem;
- text-align: center;
- }
-
- .dialog {
- max-width: 840px;
- width: 85vw;
- }
- }
-}
-
-.close {
- color: white;
- display: inline-block;
- font-family: 'Roboto Mono', monospace;
- font-size: 4rem;
- opacity: 0.75;
- padding: 0;
- position: fixed;
- right: 1rem;
- top: 0.25rem;
-
- &:hover {
- cursor: pointer;
- opacity: 1;
-
- .closeIcon {
- transform: rotate(135deg);
- }
- }
-}
-
-.closeIcon {
- height: 3rem;
- width: 3rem;
- transform: rotate(45deg);
-}
-
-.dialog {
- background-color: rgba(255, 255, 255, 0.95);
- display: flex;
- flex-direction: column;
- max-height: 90vh;
- overflow: hidden;
- position: relative;
- max-width: 740px;
- width: 75vw;
-
- > * {
- padding: 0.5rem 1rem;
- }
-}
-
-.content {
- flex: 1 1 auto;
- overflow: auto;
-
- .section {
- margin: 0;
- padding: 0;
-
- * {
- overflow-x: hidden;
- text-overflow: ellipsis;
- }
- }
-
- .section + .section {
- margin-top: 1em;
- }
-}
-
-.footer {
- padding: 0.5em 1.625em;
- text-align: right;
-}
-
-.header {
- background-color: $blue;
- color: white;
- min-height: 3rem;
-
- &,
- & > * {
- align-items: center;
- display: flex;
- flex: 0 0 auto;
- flex-direction: row;
- }
-}
-
-.heading {
- color: #888;
- font-size: 0.75em;
-}
-
-.light {
- color: #888;
-}
diff --git a/js/packages/dapp-dappreg/Modal/modal.js b/js/packages/dapp-dappreg/Modal/modal.js
deleted file mode 100644
index 6e496d2db..000000000
--- a/js/packages/dapp-dappreg/Modal/modal.js
+++ /dev/null
@@ -1,161 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import keycode from 'keycode';
-import React, { Component } from 'react';
-import ReactDOM from 'react-dom';
-import PropTypes from 'prop-types';
-
-import Button from '../Button';
-
-import styles from './modal.css';
-import CloseImage from '@parity/shared/assets/images/dapps/close.svg';
-
-export default class Modal extends Component {
- static propTypes = {
- actions: PropTypes.array,
- children: PropTypes.node,
- header: PropTypes.node,
- secondary: PropTypes.bool,
- onClose: PropTypes.func.isRequired,
- onConfirm: PropTypes.func
- };
-
- static defaultProps = {
- actions: null,
- secondary: false
- };
-
- render () {
- const { children, actions, header, secondary } = this.props;
-
- const modalClasses = [ styles.modal ];
-
- if (secondary) {
- modalClasses.push(styles.secondary);
- }
-
- return (
-
- );
- }
-
- stopEvent = (event) => {
- event.stopPropagation();
- event.preventDefault();
-
- return false;
- }
-
- handleKeyPress = (event) => {
- const codeName = keycode(event);
-
- if (codeName === 'esc') {
- return this.handleClose();
- }
-
- return event;
- }
-
- handleCloseKeyPress = (event) => {
- const codeName = keycode(event);
-
- if (codeName === 'enter') {
- return this.handleClose();
- }
-
- return event;
- }
-
- handleSetRef = (containerRef) => {
- // Focus after the modal is open
- setTimeout(() => {
- const element = ReactDOM.findDOMNode(containerRef);
-
- element && element.focus();
- }, 100);
- }
-
- handleConfirm = () => {
- this.props.onConfirm && this.props.onConfirm();
- }
-
- handleClose = () => {
- this.props.onClose();
- }
-}
diff --git a/js/packages/dapp-dappreg/ModalDelete/index.js b/js/packages/dapp-dappreg/ModalDelete/index.js
deleted file mode 100644
index 4047f9daf..000000000
--- a/js/packages/dapp-dappreg/ModalDelete/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './modalDelete';
diff --git a/js/packages/dapp-dappreg/ModalDelete/modalDelete.js b/js/packages/dapp-dappreg/ModalDelete/modalDelete.js
deleted file mode 100644
index ebe0a7faa..000000000
--- a/js/packages/dapp-dappreg/ModalDelete/modalDelete.js
+++ /dev/null
@@ -1,62 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-
-import Modal from '../Modal';
-
-import styles from '../Modal/modal.css';
-
-export default class ModalDelete extends Component {
- static propTypes = {
- dappId: PropTypes.string.isRequired,
- onClose: PropTypes.func.isRequired,
- onDelete: PropTypes.func.isRequired
- };
-
- render () {
- const { dappId, onClose, onDelete } = this.props;
- const actions = [
- { type: 'close', label: 'No, Cancel' },
- { type: 'confirm', label: 'Yes, Delete', warning: true }
- ];
-
- return (
-
-
- You are about to remove a decentralized application from the registry,
- the details of this application is given below. Removal does not return any fees,
- however the application will not be available to users anymore.
-
-
-
- Application identifier
-
-
- { dappId }
-
-
-
- );
- }
-}
diff --git a/js/packages/dapp-dappreg/ModalRegister/index.js b/js/packages/dapp-dappreg/ModalRegister/index.js
deleted file mode 100644
index 19b37586b..000000000
--- a/js/packages/dapp-dappreg/ModalRegister/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './modalRegister';
diff --git a/js/packages/dapp-dappreg/ModalRegister/modalRegister.js b/js/packages/dapp-dappreg/ModalRegister/modalRegister.js
deleted file mode 100644
index 24c01a83a..000000000
--- a/js/packages/dapp-dappreg/ModalRegister/modalRegister.js
+++ /dev/null
@@ -1,69 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import { observer } from 'mobx-react';
-import PropTypes from 'prop-types';
-
-import { api } from '../parity';
-import DappsStore from '../dappsStore';
-
-import Modal from '../Modal';
-
-import styles from '../Modal/modal.css';
-
-@observer
-export default class ModalRegister extends Component {
- static propTypes = {
- dappId: PropTypes.string.isRequired,
- onClose: PropTypes.func.isRequired,
- onRegister: PropTypes.func.isRequired
- };
-
- dappsStore = DappsStore.get();
-
- render () {
- const { onClose, onRegister } = this.props;
- const actions = [
- { type: 'close', label: 'No, Cancel' },
- { type: 'confirm', label: 'Yes, Register', warning: true }
- ];
-
- return (
-
-
- You are about to register a new decentralized application on the network, the details of
- this application is given below. This will require a non-refundable fee
- of { api.util.fromWei(this.dappsStore.fee).toFormat(3) } ETH
-
-
-
- Unique assigned application identifier
-
-
- { this.props.dappId }
-
-
-
- );
- }
-}
diff --git a/js/packages/dapp-dappreg/ModalUpdate/index.js b/js/packages/dapp-dappreg/ModalUpdate/index.js
deleted file mode 100644
index b8232275b..000000000
--- a/js/packages/dapp-dappreg/ModalUpdate/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './modalUpdate';
diff --git a/js/packages/dapp-dappreg/ModalUpdate/modalUpdate.js b/js/packages/dapp-dappreg/ModalUpdate/modalUpdate.js
deleted file mode 100644
index 8c66a4300..000000000
--- a/js/packages/dapp-dappreg/ModalUpdate/modalUpdate.js
+++ /dev/null
@@ -1,85 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-
-import Modal from '../Modal';
-
-import styles from '../Modal/modal.css';
-
-export default class ModalUpdate extends Component {
- static propTypes = {
- dappId: PropTypes.string.isRequired,
- updates: PropTypes.object.isRequired,
- onClose: PropTypes.func.isRequired,
- onConfirm: PropTypes.func.isRequired
- };
-
- render () {
- const { dappId, onClose, onConfirm } = this.props;
- const actions = [
- { type: 'close', label: 'No, Cancel' },
- { type: 'confirm', label: 'Yes, Update', warning: true }
- ];
-
- return (
-
-
- You are about to update the application details in the registry,
- the details of these updates are given below. Please note that each
- update will generate a seperate transaction.
-
- );
- });
- }
-}
diff --git a/js/packages/dapp-dappreg/SelectAccount/index.js b/js/packages/dapp-dappreg/SelectAccount/index.js
deleted file mode 100644
index 92c974a8f..000000000
--- a/js/packages/dapp-dappreg/SelectAccount/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './selectAccount';
diff --git a/js/packages/dapp-dappreg/SelectAccount/selectAccount.js b/js/packages/dapp-dappreg/SelectAccount/selectAccount.js
deleted file mode 100644
index 4ca6a99d8..000000000
--- a/js/packages/dapp-dappreg/SelectAccount/selectAccount.js
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import { observer } from 'mobx-react';
-import PropTypes from 'prop-types';
-
-import DappsStore from '../dappsStore';
-
-@observer
-export default class SelectAccount extends Component {
- dappsStore = DappsStore.get();
-
- static propTypes = {
- value: PropTypes.string.isRequired,
- onSelect: PropTypes.func.isRequired
- };
-
- render () {
- const { value } = this.props;
-
- return (
-
- );
- }
-
- renderOptions () {
- return this.dappsStore.accounts.map((account) => {
- return (
-
- );
- });
- }
-
- handleSelect = (event) => {
- this.props.onSelect && this.props.onSelect(event);
- }
-}
diff --git a/js/packages/dapp-dappreg/Transactions/index.js b/js/packages/dapp-dappreg/Transactions/index.js
deleted file mode 100644
index 0ba7422c9..000000000
--- a/js/packages/dapp-dappreg/Transactions/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './transactions';
diff --git a/js/packages/dapp-dappreg/Transactions/transactions.css b/js/packages/dapp-dappreg/Transactions/transactions.css
deleted file mode 100644
index e421e2a67..000000000
--- a/js/packages/dapp-dappreg/Transactions/transactions.css
+++ /dev/null
@@ -1,95 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.container {
- bottom: 4rem;
- position: fixed;
- right: 0;
- z-index: 150;
-}
-
-.transaction {
- display: flex;
- flex-direction: column;
- margin-top: 0.5rem;
- width: 30rem;
-
- .header {
- flex: 0 0 auto;
- height: 1.5rem;
- position: relative;
- width: 100%;
-
- > * {
- display: inline-block;
- font-family: 'Roboto Mono', monospace;
- font-size: 0.75rem;
- overflow: hidden;
- padding: 0.25rem 0.5rem;
- position: absolute;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- }
-
- .name {
- background-color: rgba(40, 40, 40, 0.95);
- color: white;
- left: 0.5rem;
- margin-right: 1.5rem;
- max-width: 20rem;
- }
-
- .date {
- background-color: rgba(215, 215, 215, 0.95);
- color: black;
- max-width: 5rem;
- right: 0.5rem;
- }
-
- .content {
- align-items: center;
- background-color: rgba(80, 80, 80, 0.95);
- color: white;
- display: flex;
- flex: 1 1 auto;
- padding: 1rem 0.75rem;
-
- > * {
- max-width: 100%;
- white-space: pre-wrap;
- word-wrap: break-word;
- }
-
- &:hover {
- cursor: pointer;
- }
-
- &.error {
- background-color: rgba(255, 68, 68, 0.95);
- }
-
- &.pending {
- background-color: rgba(243, 156, 18, 0.95);
- }
-
- &.confirmed {
- background-color: rgba(39, 174, 96, 0.95);
- color: white;
- }
- }
-}
diff --git a/js/packages/dapp-dappreg/Transactions/transactions.js b/js/packages/dapp-dappreg/Transactions/transactions.js
deleted file mode 100644
index db15d0b2a..000000000
--- a/js/packages/dapp-dappreg/Transactions/transactions.js
+++ /dev/null
@@ -1,136 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import { observer } from 'mobx-react';
-
-import DappsStore from '../dappsStore';
-
-import styles from './transactions.css';
-
-@observer
-export default class Transactions extends Component {
- dappsStore = DappsStore.get();
-
- render () {
- const { transactions } = this.dappsStore;
- const displayedTransactions = Object.values(transactions)
- .filter((tx) => !tx.hide)
- .sort((txA, txB) => txB.start - txA.start);
-
- return (
-
- Transaction mined at block { transactionReceipt.blockNumber.toFormat(0) }
-
- );
- }
-
- if (transactionHash) {
- return (
-
- Transaction sent to network with hash { transactionHash }..
-
- );
- }
-
- return (
-
- Transaction waiting to be signed...
-
- );
- }
-
- handleHideTransaction = (event, requestId) => {
- this.dappsStore.updateTransaction(requestId, { hide: true });
- }
-}
diff --git a/js/packages/dapp-dappreg/Warning/index.js b/js/packages/dapp-dappreg/Warning/index.js
deleted file mode 100644
index b0096ae62..000000000
--- a/js/packages/dapp-dappreg/Warning/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './warning';
diff --git a/js/packages/dapp-dappreg/Warning/warning.css b/js/packages/dapp-dappreg/Warning/warning.css
deleted file mode 100644
index 296fa10fc..000000000
--- a/js/packages/dapp-dappreg/Warning/warning.css
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-@import '../_colors.css';
-
-.warning {
- background: $warning-bg;
- border-top-right-radius: 0.25em;
- bottom: 0;
- color: white;
- cursor: pointer;
- font-size: 0.75em;
- left: 0;
- line-height: 1.5em;
- opacity: 1;
- padding: 1.5em;
- position: fixed;
- max-width: 540px;
- z-index: 100;
-
- div+div {
- margin-top: 1.5em;
- }
-}
diff --git a/js/packages/dapp-dappreg/Warning/warning.js b/js/packages/dapp-dappreg/Warning/warning.js
deleted file mode 100644
index 2dbbca688..000000000
--- a/js/packages/dapp-dappreg/Warning/warning.js
+++ /dev/null
@@ -1,55 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-
-import { api } from '../parity';
-import DappsStore from '../dappsStore';
-
-import styles from './warning.css';
-
-export default class Warning extends Component {
- dappsStore = DappsStore.get();
-
- state = {
- show: true
- };
-
- render () {
- if (!this.state.show) {
- return null;
- }
-
- return (
-
-
- WARNING: Registering a dapp is for developers only. Please ensure you understand the
- steps needed to develop and deploy applications, should you wish to use this dapp for
- anything apart from queries.
-
-
- A non-refundable fee
- of { api.util.fromWei(this.dappsStore.fee).toFormat(3) } ETH is required
- for any registration.
-
-
- );
- }
-
- onClose = () => {
- this.setState({ show: false });
- }
-}
diff --git a/js/packages/dapp-dappreg/_colors.css b/js/packages/dapp-dappreg/_colors.css
deleted file mode 100644
index 7bfc5591d..000000000
--- a/js/packages/dapp-dappreg/_colors.css
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-$blue: rgb(41, 128, 185);
-$disabled-bg: #aaa;
-$warning-bg: #e44;
-$modal-bg: rgba(40, 40, 40, 0.75);
-
-$background-color: #eee;
-$text-color: #333;
-$loading-color: #999;
-
-$code-bg: #002b36;
-$code-color: #b58900;
-$code-title-bg: #073642;
-$code-title-color: #859900;
diff --git a/js/packages/dapp-dappreg/_utils.css b/js/packages/dapp-dappreg/_utils.css
deleted file mode 100644
index 682120f7c..000000000
--- a/js/packages/dapp-dappreg/_utils.css
+++ /dev/null
@@ -1,22 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.bezier-transform {
- transition-duration: 0.1s;
- transition-property: all;
- transition-timing-function: cubic-bezier(0.7, 0, 0.3, 1);
-}
diff --git a/js/packages/dapp-dappreg/dappStore.js b/js/packages/dapp-dappreg/dappStore.js
deleted file mode 100644
index bef02729d..000000000
--- a/js/packages/dapp-dappreg/dappStore.js
+++ /dev/null
@@ -1,153 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { action, computed, observable, transaction } from 'mobx';
-
-export default class DappStore {
- @observable id = null;
- @observable content = null;
- @observable image = null;
- @observable manifest = null;
- @observable owner = null;
- @observable isOwner = false;
-
- @observable isEditing = false;
- @observable wip = null;
-
- contractOwner = '';
- isContractOwner = false;
-
- constructor (data) {
- const { id, content = {}, image = {}, manifest = {}, owner = {}, isOwner = false, contractOwner = '', isContractOwner = false } = data;
-
- transaction(() => {
- this.id = id;
- this.content = content;
- this.image = image;
- this.manifest = manifest;
- this.owner = owner;
- this.isOwner = isOwner;
-
- this.copyToWip();
- });
-
- this.contractOwner = contractOwner;
- this.isContractOwner = isContractOwner;
- }
-
- @computed get canSave () {
- if (!this.wip) {
- return false;
- }
-
- const { content, image, manifest, owner } = this.wip;
- const fields = [ content, image, manifest, owner ];
-
- const hasError = !!fields.find((field) => field.error);
- const hasChanged = !!fields.find((field) => field.changed);
- const isEditMode = this.isEditing;
-
- return isEditMode && hasChanged && !hasError;
- }
-
- @action copyToWip = () => {
- const defaults = {
- changed: false,
- error: null
- };
-
- const wip = {
- id: this.id,
- content: {
- ...defaults,
- url: this.content.url
- },
- image: {
- ...defaults,
- url: this.image.url
- },
- manifest: {
- ...defaults,
- url: this.manifest.url
- },
- owner: {
- ...defaults,
- address: this.owner.address
- }
- };
-
- this.wip = { ...wip };
- }
-
- @action handleChange = (details) => {
- if (!this.isEditing) {
- return false;
- }
-
- this.wip = {
- ...this.wip,
- ...details
- };
-
- return this.wip;
- }
-
- @action handleSave = () => {
- const updates = {};
-
- if (this.wip.content.url !== this.content.url) {
- updates.content = this.wip.content.url;
- }
-
- if (this.wip.image.url !== this.image.url) {
- updates.image = this.wip.image.url;
- }
-
- if (this.wip.manifest.url !== this.manifest.url) {
- updates.manifest = this.wip.manifest.url;
- }
-
- if (this.wip.owner.address !== this.owner.address) {
- updates.owner = this.wip.owner.address;
- }
-
- return updates;
- }
-
- @action setEditing = (mode) => {
- transaction(() => {
- this.isEditing = mode;
- this.copyToWip();
- });
-
- return mode;
- }
-
- update = (updates) => {
- const { image, content } = updates;
- const changes = {};
-
- if (image && image !== this.wip.image.url) {
- changes.image = { url: image, changed: true };
- }
-
- if (content && content !== this.wip.content.url) {
- changes.content = { url: content, changed: true };
- }
-
- return this.handleChange(changes);
- }
-}
diff --git a/js/packages/dapp-dappreg/dappsStore.js b/js/packages/dapp-dappreg/dappsStore.js
deleted file mode 100644
index a5fed961f..000000000
--- a/js/packages/dapp-dappreg/dappsStore.js
+++ /dev/null
@@ -1,522 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import BigNumber from 'bignumber.js';
-import { action, computed, observable, transaction } from 'mobx';
-import { flatten } from 'lodash';
-
-import * as abis from '@parity/shared/contracts/abi';
-import Contracts from '@parity/shared/contracts';
-import builtinJson from '@parity/shared/config/dappsBuiltin.json';
-
-import Dapp from './dappStore.js';
-import { deleteDapp, registerDapp, updateDapp } from './utils';
-
-import { api, trackRequest } from './parity';
-
-const builtins = builtinJson.filter((app) => app.id);
-
-let instance = null;
-
-export default class DappsStore {
- @observable accounts = [];
- @observable apps = [];
- @observable contractOwner = null;
- @observable count = 0;
- @observable fee = new BigNumber(0);
- @observable isContractOwner = false;
- @observable isLoading = true;
- @observable transactions = {};
-
- _instanceGhh = null;
- _instanceReg = null;
- _registry = null;
- _startTime = Date.now();
-
- constructor () {
- this._loadDapps();
- }
-
- static get () {
- if (!instance) {
- instance = new DappsStore();
- }
-
- return instance;
- }
-
- createDappId () {
- return api.util.sha3(`${this._startTime}_${Date.now()}`);
- }
-
- @computed get ownedCount () {
- return this.ownDapps.length;
- }
-
- @computed get ownDapps () {
- return this.apps.filter((app) => app.isOwner);
- }
-
- @computed get otherDapps () {
- return this.apps.filter((app) => !app.isOwner);
- }
-
- @action sortApps = () => {
- // Sort dapps per name, then per id
- const sort = (a, b) => {
- if (a.name && b.name) {
- return a.name.localeCompare(b.name);
- }
-
- if (a.name) {
- return -1;
- }
-
- if (b.name) {
- return 1;
- }
-
- return a.id - b.id;
- };
-
- transaction(() => {
- const ownDapps = this.ownDapps.sort(sort);
- const otherDapps = this.otherDapps.sort(sort);
-
- this.apps = ownDapps.concat(otherDapps);
- });
- }
-
- @action setApps = (dapps) => {
- const filteredDapps = dapps.filter((dapp) => {
- return new BigNumber(dapp.id).gt(0);
- });
-
- transaction(() => {
- this.apps = filteredDapps;
- this.sortApps();
- });
- }
-
- @action refreshApp = (dappId) => {
- const dapp = this.apps.find((dapp) => dapp.id === dappId);
-
- this._loadDapp(dapp);
- }
-
- @action removeApp = (dappId) => {
- const dapps = this.apps.filter((dapp) => dapp.id !== dappId);
-
- this.setApps(dapps);
- }
-
- @action setAccounts = (accountsInfo) => {
- transaction(() => {
- this.accounts = Object
- .keys(accountsInfo)
- .map((address) => {
- const account = accountsInfo[address];
-
- account.address = address;
- return account;
- });
- });
-
- return this.accounts;
- }
-
- @action setContractOwner = (contractOwner) => {
- transaction(() => {
- this.contractOwner = contractOwner;
- this.isContractOwner = !!this.accounts.find((account) => account.address === contractOwner);
- });
- return contractOwner;
- }
-
- @action setCount = (count) => {
- this.count = count;
- return count;
- }
-
- @action setFee = (fee) => {
- this.fee = fee;
- return fee;
- }
-
- @action setLoading = (loading) => {
- this.isLoading = loading;
- return loading;
- }
-
- @action updateTransaction = (requestId, nextData) => {
- const prevTransaction = this.transactions[requestId] || { requestId };
- const nextTransaction = {
- ...prevTransaction,
- hide: false,
- ...nextData
- };
-
- this.transactions = {
- ...this.transactions,
- [ requestId ]: nextTransaction
- };
- }
-
- fetchRegistryData (dapp) {
- const ownerAddress = (dapp.wip && dapp.wip.owner.address) || dapp.owner.address;
-
- this._registry.reverse
- .call({}, [ ownerAddress ])
- .then((name) => {
- if (!name) {
- return;
- }
-
- const key = api.util.sha3.text(name);
-
- return Promise
- .all([
- this._registry.get.call({}, [ key, 'IMG' ])
- .then((bytes) => api.util.bytesToHex(bytes))
- .then((hash) => this._instanceGhh.entries.call({}, [ hash ])),
- this._registry.get.call({}, [ key, 'CONTENT' ])
- .then((bytes) => api.util.bytesToHex(bytes))
- .then((hash) => this._instanceGhh.entries.call({}, [ hash ]))
- ])
- .then(([ imageGHH, contentGHH ]) => {
- const imageUrl = imageGHH[0];
- const contentUrl = contentGHH[0];
-
- return dapp.update({
- image: imageUrl,
- content: contentUrl
- });
- });
- });
- }
-
- register (dappId) {
- const dappRegInstance = this._instanceReg;
- const dappRegFee = this.fee;
-
- return registerDapp(dappId, dappRegInstance, dappRegFee)
- .then((request) => this.trackRequest(request, `Registering ${dappId}`))
- .then(() => this._loadDapps());
- }
-
- delete (dapp) {
- const dappRegInstance = this._instanceReg;
-
- return deleteDapp(dapp, dappRegInstance)
- .then((request) => this.trackRequest(request, `Deleting ${dapp.id}`))
- .then(() => this._loadDapps());
- }
-
- update (dappId, dappOwner, updates) {
- const dappRegInstance = this._instanceReg;
- const ghhRegInstance = this._instanceGhh;
-
- const promises = updateDapp(dappId, dappOwner, updates, dappRegInstance, ghhRegInstance);
- const handledPromises = promises.map((promise) => {
- return promise
- .then((requests) => {
- const requestPromises = flatten([].concat(requests))
- .filter((request) => request)
- .map((request) => this.trackRequest(request.id, request.name));
-
- return Promise.all(requestPromises);
- })
- .catch((error) => {
- const randomRequestId = api.util.sha3(Date.now()).slice(0, 5);
-
- this.updateTransaction(randomRequestId, { start: Date.now(), error });
- });
- });
-
- return Promise.all(handledPromises)
- .then(() => this._loadDapps());
- }
-
- trackRequest (requestId, name) {
- const statusCallback = (error, data) => {
- if (error) {
- return this.updateTransaction(requestId, { error });
- }
-
- return this.updateTransaction(requestId, data);
- };
-
- this.updateTransaction(requestId, { name, start: Date.now() });
- return trackRequest(requestId, statusCallback);
- }
-
- lookupHash (hash) {
- return this._retrieveUrl(hash);
- }
-
- _getCount () {
- return this._instanceReg
- .count.call()
- .then((count) => {
- this.setCount(count.toNumber());
- })
- .catch((error) => {
- console.error('Store:getCount', error);
- });
- }
-
- _getFee () {
- return this._instanceReg
- .fee.call()
- .then(this.setFee)
- .catch((error) => {
- console.error('Store:getFee', error);
- });
- }
-
- _getOwner () {
- return this._instanceReg
- .owner.call()
- .then(this.setContractOwner)
- .catch((error) => {
- console.error('Store:getOwner', error);
- });
- }
-
- _loadDapps () {
- return this._loadRegistry()
- .then(() => Promise.all([
- this._attachContracts(),
- this._loadAccounts()
- ]))
- .then(() => Promise.all([
- this._getCount(),
- this._getFee(),
- this._getOwner()
- ]))
- .then(() => {
- const promises = [];
-
- for (let index = 0; index < this.count; index++) {
- promises.push(this._instanceReg.at.call({}, [index]));
- }
-
- return Promise.all(promises);
- })
- .then((dappsInfo) => {
- const dapps = dappsInfo.reduce((dapps, [dappId, ownerAddress]) => {
- const id = api.util.bytesToHex(dappId);
- const owner = this.accounts.find((account) => account.address === ownerAddress);
- const isOwner = !!owner;
- const dapp = {
- id,
- owner: owner || { address: ownerAddress },
- isOwner
- };
-
- dapps[id] = dapp;
- return dapps;
- }, {});
-
- const promises = Object.values(dapps)
- // Only show dapps with id and owners
- .filter((dapp) => dapp.id && dapp.owner && !/^(0x)?0*$/.test(dapp.owner.address))
- .map((dapp) => this._loadDapp(dapp));
-
- return Promise.all(promises);
- })
- .then((dapps) => {
- this.setApps(dapps);
- this.sortApps();
- this.setLoading(false);
- })
- .catch((error) => {
- console.error('Store:loadDapps', error);
- });
- }
-
- _loadDapp = (dappData) => {
- const { id, owner, isOwner } = dappData;
-
- return Promise
- .all([
- this._loadMeta(id, 'CONTENT'),
- this._loadMeta(id, 'IMG'),
- this._loadMeta(id, 'MANIFEST')
- ])
- .then(([contentHash, imageHash, manifestHash]) => {
- return Promise
- .all([
- this._retrieveUrl(contentHash),
- this._retrieveUrl(imageHash),
- this._retrieveUrl(manifestHash)
- ])
- .then(([contentUrl, imageUrl, manifestUrl]) => {
- return this
- ._loadManifest(id, manifestHash, manifestUrl)
- .then((manifestContent) => {
- const content = {
- hash: contentHash,
- url: contentUrl
- };
-
- const image = {
- hash: imageHash,
- url: imageUrl
- };
-
- const manifest = {
- content: manifestContent,
- hash: manifestHash,
- url: manifestUrl
- };
-
- return { content, image, manifest };
- });
- });
- })
- .catch((error) => {
- console.error('dappsStore::loadDapp', error);
- return {};
- })
- .then((data) => {
- const { content, image, manifest } = data;
-
- const dapp = new Dapp({
- contractOwner: this.contractOwner,
- isContractOwner: this.isContractOwner,
- id,
- content,
- image,
- manifest,
- owner,
- isOwner
- });
-
- return dapp;
- });
- }
-
- _loadMeta (appId, key) {
- return this._instanceReg
- .meta.call({}, [appId, key])
- .then((meta) => {
- const hash = api.util.bytesToHex(meta);
- const bnhash = new BigNumber(hash);
-
- return bnhash.gt(0)
- ? hash
- : null;
- })
- .catch((error) => {
- console.error('Store:loadMeta', error);
- return null;
- });
- }
-
- _loadManifest (appId, manifestHash) {
- const builtin = builtins.find((app) => app.id === appId);
-
- if (builtin) {
- return Promise.resolve(builtin);
- }
-
- if (!manifestHash) {
- return Promise.resolve(null);
- }
-
- return fetch(`/api/content/${manifestHash.substr(2)}/`, { redirect: 'follow', mode: 'cors' })
- .then((response) => {
- return response.ok
- ? response.json()
- : null;
- })
- .catch((error) => {
- console.error('Store:loadManifest', error);
- return null;
- });
- }
-
- _retrieveUrl (urlHash) {
- if (!urlHash) {
- return Promise.resolve(null);
- }
-
- return this._instanceGhh
- .entries.call({}, [urlHash])
- .then(([repo, _commit, owner]) => {
- const bnowner = new BigNumber(owner);
-
- if (bnowner.eq(0)) {
- return null;
- }
-
- const commit = api.util.bytesToHex(_commit);
- const bncommit = new BigNumber(commit);
-
- if (bncommit.eq(0)) {
- return repo;
- } else {
- return `https://codeload.github.com/${repo}/zip/${commit.substr(2)}`;
- }
- })
- .catch((error) => {
- console.error('Store:retriveUrl', error);
- return null;
- });
- }
-
- _loadAccounts () {
- return api.parity
- .accountsInfo()
- .then(this.setAccounts)
- .catch((error) => {
- console.error('Store:loadAccounts', error);
- });
- }
-
- _loadRegistry () {
- return Contracts.get(api).registry
- .fetchContract()
- .then((contract) => {
- this._registry = contract.instance;
- })
- .catch((error) => {
- console.error('Store:loadRegistry', error);
- });
- }
-
- _attachContracts () {
- return Promise
- .all([
- this._registry.getAddress.call({}, [api.util.sha3('dappreg'), 'A']),
- this._registry.getAddress.call({}, [api.util.sha3('githubhint'), 'A'])
- ])
- .then(([dappregAddress, ghhAddress]) => {
- console.log(`dappreg was found at ${dappregAddress}`);
- console.log(`githubhint was found at ${ghhAddress}`);
-
- this._contractReg = api.newContract(abis.dappreg, dappregAddress);
- this._instanceReg = this._contractReg.instance;
-
- this._contractGhh = api.newContract(abis.githubhint, ghhAddress);
- this._instanceGhh = this._contractGhh.instance;
- })
- .catch((error) => {
- console.error('Store:attachContract', error);
- });
- }
-}
diff --git a/js/packages/dapp-dappreg/index.js b/js/packages/dapp-dappreg/index.js
deleted file mode 100644
index 48eb5938b..000000000
--- a/js/packages/dapp-dappreg/index.js
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React from 'react';
-import ReactDOM from 'react-dom';
-import injectTapEventPlugin from 'react-tap-event-plugin';
-import { AppContainer } from 'react-hot-loader';
-
-injectTapEventPlugin();
-
-import Application from './Application';
-
-import '@parity/shared/assets/fonts/Roboto/font.css';
-import '@parity/shared/assets/fonts/RobotoMono/font.css';
-import '@parity/dapps/style.css';
-
-ReactDOM.render(
-
-
- ,
- document.querySelector('#container')
-);
-
-if (module.hot) {
- module.hot.accept('./Application/index.js', () => {
- require('./Application/index.js');
-
- ReactDOM.render(
-
-
- ,
- document.querySelector('#container')
- );
- });
-}
diff --git a/js/packages/dapp-dappreg/package.json b/js/packages/dapp-dappreg/package.json
deleted file mode 100644
index 0ec2083f8..000000000
--- a/js/packages/dapp-dappreg/package.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "name": "@parity/dapp-dappreg",
- "description": "Parity dapps",
- "version": "1.99.99",
- "main": "index.js",
- "author": "Parity Team ",
- "maintainers": [],
- "contributors": [],
- "license": "GPL-3.0",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/paritytech/dapp-dappreg.git"
- },
- "keywords": [],
- "scripts": {},
- "devDependencies": {},
- "dependencies": {
- },
- "peerDependencies": {}
-}
diff --git a/js/packages/dapp-dappreg/parity.js b/js/packages/dapp-dappreg/parity.js
deleted file mode 100644
index 07aa818eb..000000000
--- a/js/packages/dapp-dappreg/parity.js
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import Api from '@parity/api';
-
-const ethereumProvider = window.ethereum || window.parent.ethereum;
-
-if (!ethereumProvider) {
- throw new Error('Unable to locate EthereumProvider, object not attached');
-}
-
-const api = new Api(ethereumProvider);
-
-function trackRequest (signerRequestId, statusCallback) {
- return api.pollMethod('parity_checkRequest', signerRequestId)
- .then((transactionHash) => {
- console.log('trackRequest', `received transaction hash ${transactionHash}`);
- statusCallback(null, { transactionHash });
-
- return api.pollMethod('eth_getTransactionReceipt', transactionHash, (receipt) => {
- if (!receipt || !receipt.blockNumber || receipt.blockNumber.eq(0)) {
- return false;
- }
-
- return true;
- });
- })
- .then((transactionReceipt) => {
- console.log('trackRequest', 'received transaction receipt', transactionReceipt);
- statusCallback(null, { transactionReceipt });
- })
- .catch((error) => {
- statusCallback(error);
- });
-}
-
-export {
- api,
- trackRequest
-};
diff --git a/js/packages/dapp-dappreg/utils.js b/js/packages/dapp-dappreg/utils.js
deleted file mode 100644
index 74ece1b95..000000000
--- a/js/packages/dapp-dappreg/utils.js
+++ /dev/null
@@ -1,190 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { api } from './parity';
-
-export const INVALID_URL_HASH = '0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470';
-export const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';
-
-export function isContentHash (url) {
- return /^0x[0-9a-f]{64}/.test(url);
-}
-
-/**
- * Convert the given URL to a content hash,
- * and checks if it is already registered in GHH
- */
-export const urlToHash = (api, instance, url) => {
- if (!url || !url.length) {
- return Promise.resolve(null);
- }
-
- const hashPromise = isContentHash(url)
- ? Promise.resolve(url)
- : api.parity.hashContent(url);
-
- return hashPromise
- .catch((error) => {
- const message = error.text || error.message || error.toString();
-
- throw new Error(`${message} (${url})`);
- })
- .then((contentHash) => {
- console.log('lookupHash', url, contentHash);
-
- if (contentHash === INVALID_URL_HASH) {
- throw new Error(`"${url}" is not a valid URL`);
- }
-
- return instance.entries
- .call({}, [contentHash])
- .then(([accountSlashRepo, commit, contentHashOwner]) => {
- const registered = (contentHashOwner !== ZERO_ADDRESS);
-
- return {
- hash: contentHash,
- registered
- };
- });
- });
-};
-
-/**
- * Register the given URL to GithubHint
- * registry contract
- */
-export const registerGHH = (instance, url, hash, owner) => {
- const values = [ hash, url ];
- const options = {
- from: owner
- };
-
- return instance
- .hintURL.estimateGas(options, values)
- .then((gas) => {
- options.gas = gas.mul(1.2).toFixed(0);
- return instance.hintURL.postTransaction(options, values);
- });
-};
-
-export const registerDapp = (dappId, dappRegInstance) => {
- const values = [ dappId ];
- const options = {};
-
- return dappRegInstance
- .fee.call({}, [])
- .then((fee) => {
- options.value = fee;
-
- return dappRegInstance
- .register.estimateGas(options, values)
- .then((gas) => {
- options.gas = gas.mul(1.2).toFixed(0);
- return dappRegInstance.register.postTransaction(options, values);
- });
- });
-};
-
-export const deleteDapp = (dapp, dappRegInstance) => {
- const { id, owner } = dapp;
-
- const fromAddress = dapp.isOwner
- ? owner.address
- : dapp.contractOwner;
-
- const values = [ id ];
- const options = {
- from: fromAddress
- };
-
- return dappRegInstance
- .unregister.estimateGas(options, values)
- .then((gas) => {
- options.gas = gas.mul(1.2).toFixed(0);
-
- return dappRegInstance.unregister.postTransaction(options, values);
- });
-};
-
-export const updateDappOwner = (dappId, dappOwner, nextOwnerAddress, dappRegInstance) => {
- const options = {
- from: dappOwner
- };
-
- const values = [ dappId, nextOwnerAddress ];
-
- return dappRegInstance.setDappOwner
- .estimateGas(options, values)
- .then((gas) => {
- options.gas = gas.mul(1.2);
-
- return dappRegInstance.setDappOwner.postTransaction(options, values);
- });
-};
-
-export const updateDapp = (dappId, dappOwner, updates, dappRegInstance, ghhRegInstance) => {
- const options = {
- from: dappOwner
- };
-
- const types = {
- content: 'CONTENT',
- image: 'IMG',
- manifest: 'MANIFEST'
- };
-
- const promises = Object
- .keys(updates)
- .map((type) => {
- const key = types[type];
- const url = updates[type];
- let promise;
-
- if (!url) {
- promise = Promise.resolve([ null, '' ]);
- } else {
- promise = urlToHash(api, ghhRegInstance, url)
- .then((ghhResult) => {
- const { hash, registered } = ghhResult;
-
- if (!registered) {
- return registerGHH(ghhRegInstance, url, hash, dappOwner)
- .then((requestId) => [ { id: requestId, name: `Registering ${url}` }, hash ]);
- }
-
- return [ null, hash ];
- });
- }
-
- return promise
- .then(([ ghhRequest, hash ]) => {
- const values = [ dappId, key, hash ];
-
- return dappRegInstance.setMeta.estimateGas(options, values)
- .then((gas) => {
- options.gas = gas.mul(1.2).toFixed(0);
- return dappRegInstance.setMeta.postTransaction(options, values);
- })
- .then((requestId) => [ ghhRequest, { id: requestId, name: `Updating ${type} of ${dappId}` } ]);
- });
- });
-
- if (updates.owner) {
- promises.push(updateDappOwner(updates.owner).then((reqId) => ({ id: reqId, name: `Updating owner of ${dappId}` })));
- }
-
- return promises;
-};
diff --git a/js/packages/dapp-dappreg/utils.spec.js b/js/packages/dapp-dappreg/utils.spec.js
deleted file mode 100644
index 6101ff976..000000000
--- a/js/packages/dapp-dappreg/utils.spec.js
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { INVALID_URL_HASH, ZERO_ADDRESS, isContentHash } from './utils';
-
-describe('dapps/dappreg/utils', () => {
- describe('isContentHash', () => {
- it('returns true on valid hashes', () => {
- expect(isContentHash(INVALID_URL_HASH)).to.be.true;
- });
-
- it('returns false on valid hex, invalid hash', () => {
- expect(isContentHash(ZERO_ADDRESS)).to.be.false;
- });
-
- it('returns false on invalid hex', () => {
- expect(isContentHash('something')).to.be.false;
- });
- });
-});
diff --git a/js/packages/dapp-develop/LoadContract/index.js b/js/packages/dapp-develop/LoadContract/index.js
deleted file mode 100644
index 2db3f0212..000000000
--- a/js/packages/dapp-develop/LoadContract/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './loadContract';
diff --git a/js/packages/dapp-develop/LoadContract/loadContract.css b/js/packages/dapp-develop/LoadContract/loadContract.css
deleted file mode 100644
index ce9011c5d..000000000
--- a/js/packages/dapp-develop/LoadContract/loadContract.css
+++ /dev/null
@@ -1,52 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.loadContainer {
- display: flex;
- flex-direction: row;
-
- > * {
- flex: 50%;
- width: 0;
- }
-}
-
-.editor {
- display: flex;
- flex-direction: column;
- padding-left: 1em;
-
- p {
- line-height: 48px;
- height: 48px;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
-
- margin: 0;
- font-size: 1.2em;
- }
-}
-
-.confirmRemoval {
- text-align: center;
-
- .editor {
- text-align: left;
- margin-top: 0.5em;
- }
-}
diff --git a/js/packages/dapp-develop/LoadContract/loadContract.js b/js/packages/dapp-develop/LoadContract/loadContract.js
deleted file mode 100644
index 2788e2a68..000000000
--- a/js/packages/dapp-develop/LoadContract/loadContract.js
+++ /dev/null
@@ -1,343 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import moment from 'moment';
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-
-import { Button, List, Portal, Tabs } from '@parity/ui';
-import Editor from '@parity/ui/Editor';
-import { CancelIcon, CheckIcon, DeleteIcon } from '@parity/ui/Icons';
-
-import styles from './loadContract.css';
-
-const REMOVAL_STYLE = {
- backgroundColor: 'none',
- cursor: 'default'
-};
-
-// const SELECTED_STYLE = {
-// backgroundColor: 'rgba(255, 255, 255, 0.1)'
-// };
-
-export default class LoadContract extends Component {
- static propTypes = {
- onClose: PropTypes.func.isRequired,
- onLoad: PropTypes.func.isRequired,
- onDelete: PropTypes.func.isRequired,
- contracts: PropTypes.object.isRequired,
- snippets: PropTypes.object.isRequired
- };
-
- state = {
- activeTab: -1,
- selected: -1,
- deleteRequest: false,
- deleteId: -1
- };
-
- render () {
- const { deleteRequest } = this.state;
-
- return (
-
- )
- : (
-
- )
- }
- >
- { this.renderBody() }
-
- );
- }
-
- renderBody () {
- const { activeTab, deleteRequest } = this.state;
-
- if (deleteRequest) {
- return this.renderConfirmRemoval();
- }
-
- const { contracts, snippets } = this.props;
- const contractsTab = Object.keys(contracts).length === 0
- ? null
- : (
-
- );
-
- return (
-
- );
- }
-
- renderContracts (contracts, removable = true) {
- return Object
- .values(contracts)
- .map((contract) => {
- const { id, name, timestamp, description } = contract;
- const onDelete = () => this.onDeleteRequest(id);
-
- return {
- key: id,
- label: name,
- buttons: removable && (
- }
- onClick={ onDelete }
- />
- ),
- description: description || (
-
- )
- };
- });
- }
-
- renderDialogActions () {
- const { deleteRequest } = this.state;
-
- if (deleteRequest) {
- return [
- }
- key='No'
- label={
-
- }
- onClick={ this.onRejectRemoval }
- />,
- }
- key='Yes'
- label={
-
- }
- onClick={ this.onConfirmRemoval }
- />
- ];
- }
-
- return [
- }
- key='cancel'
- label={
-
- }
- onClick={ this.onClose }
- />,
- }
- key='load'
- label={
-
- }
- onClick={ this.onLoad }
- />
- ];
- }
-
- handleChangeTab = (event, activeTab) => {
- this.setState({ activeTab, selected: -1 });
- }
-
- onClickContract = (event, selected) => {
- this.setState({ selected });
- }
-
- onClose = () => {
- this.props.onClose();
- }
-
- onLoad = () => {
- const { contracts, snippets } = this.props;
- const { selected } = this.state;
-
- const mergedContracts = Object.assign({}, contracts, snippets);
- const contract = mergedContracts[selected];
-
- this.props.onLoad(contract);
- this.props.onClose();
- }
-
- onDeleteRequest = (id) => {
- this.setState({
- deleteRequest: true,
- deleteId: id
- });
- }
-
- onConfirmRemoval = () => {
- const { deleteId } = this.state;
-
- this.props.onDelete(deleteId);
-
- this.setState({
- deleteRequest: false,
- deleteId: -1,
- selected: -1
- });
- }
-
- onRejectRemoval = () => {
- this.setState({
- deleteRequest: false,
- deleteId: -1
- });
- }
-}
diff --git a/js/packages/dapp-develop/LoadContract/loadContract.spec.js b/js/packages/dapp-develop/LoadContract/loadContract.spec.js
deleted file mode 100644
index b79a0875b..000000000
--- a/js/packages/dapp-develop/LoadContract/loadContract.spec.js
+++ /dev/null
@@ -1,159 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { shallow } from 'enzyme';
-import React from 'react';
-import sinon from 'sinon';
-
-import LoadContract from './';
-
-const CONTRACTS = {
- 345: { id: 345, name: 'test345' },
- 456: { id: 456, name: 'test456' },
- 987: { id: 987, name: 'test987' }
-};
-const SNIPPETS = {
- 123: { id: 123, name: 'test123' }
-};
-
-let component;
-let instance;
-let onClose;
-let onDelete;
-let onLoad;
-
-function render () {
- onClose = sinon.stub();
- onDelete = sinon.stub();
- onLoad = sinon.stub();
- component = shallow(
-
- );
- instance = component.instance();
-
- return component;
-}
-
-describe('modals/LoadContract', () => {
- beforeEach(() => {
- render();
- });
-
- it('renders defaults', () => {
- expect(component).to.be.ok;
- });
-
- describe('event methods', () => {
- describe('handleChangeTab', () => {
- beforeEach(() => {
- instance.onClickContract(null, 345);
- instance.handleChangeTab();
- });
-
- it('resets the selected value', () => {
- expect(instance.state.selected).to.equal(-1);
- });
- });
-
- describe('onClickContract', () => {
- beforeEach(() => {
- instance.onClickContract(null, 456);
- });
-
- it('sets the selected value', () => {
- expect(instance.state.selected).to.equal(456);
- });
- });
-
- describe('onClose', () => {
- beforeEach(() => {
- instance.onClose();
- });
-
- it('calls onClose', () => {
- expect(onClose).to.have.been.called;
- });
- });
-
- describe('onLoad', () => {
- beforeEach(() => {
- instance.onLoad();
- });
-
- it('calls onLoad', () => {
- expect(onLoad).to.have.been.called;
- });
-
- it('calls onClose', () => {
- expect(onClose).to.have.been.called;
- });
- });
-
- describe('onDeleteRequest', () => {
- beforeEach(() => {
- instance.onDeleteRequest(987);
- });
-
- it('sets deleteRequest true', () => {
- expect(instance.state.deleteRequest).to.be.true;
- });
-
- it('sets the deleteId', () => {
- expect(instance.state.deleteId).to.equal(987);
- });
- });
-
- describe('onConfirmRemoval', () => {
- beforeEach(() => {
- instance.onDeleteRequest(987);
- instance.onConfirmRemoval();
- });
-
- it('calls onDelete', () => {
- expect(onDelete).to.have.been.calledWith(987);
- });
-
- it('sets deleteRequest false', () => {
- expect(instance.state.deleteRequest).to.be.false;
- });
-
- it('clears the deleteId', () => {
- expect(instance.state.deleteId).to.equal(-1);
- });
- });
-
- describe('onRejectRemoval', () => {
- beforeEach(() => {
- instance.onDeleteRequest(987);
- instance.onRejectRemoval();
- });
-
- it('sets deleteRequest false', () => {
- expect(instance.state.deleteRequest).to.be.false;
- });
-
- it('clears the deleteId', () => {
- expect(instance.state.deleteId).to.equal(-1);
- });
- });
- });
-});
diff --git a/js/packages/dapp-develop/SaveContract/index.js b/js/packages/dapp-develop/SaveContract/index.js
deleted file mode 100644
index fce35db96..000000000
--- a/js/packages/dapp-develop/SaveContract/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './saveContract';
diff --git a/js/packages/dapp-develop/SaveContract/saveContract.css b/js/packages/dapp-develop/SaveContract/saveContract.css
deleted file mode 100644
index 22ef7da28..000000000
--- a/js/packages/dapp-develop/SaveContract/saveContract.css
+++ /dev/null
@@ -1,20 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.source {
- margin-top: 2em;
-}
diff --git a/js/packages/dapp-develop/SaveContract/saveContract.js b/js/packages/dapp-develop/SaveContract/saveContract.js
deleted file mode 100644
index 84e3446e8..000000000
--- a/js/packages/dapp-develop/SaveContract/saveContract.js
+++ /dev/null
@@ -1,137 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-
-import { ERRORS, validateName } from '@parity/shared/util/validation';
-import { Button, Form, Input, Portal } from '@parity/ui';
-import Editor from '@parity/ui/Editor';
-import { CancelIcon, SaveIcon } from '@parity/ui/Icons';
-
-import styles from './saveContract.css';
-
-export default class SaveContract extends Component {
- static propTypes = {
- sourcecode: PropTypes.string.isRequired,
- onClose: PropTypes.func.isRequired,
- onSave: PropTypes.func.isRequired
- };
-
- state = {
- name: '',
- nameError: ERRORS.invalidName
- };
-
- render () {
- const { sourcecode } = this.props;
- const { name, nameError } = this.state;
-
- return (
-
- }
- >
-
-
-
-
-
- );
- }
-
- renderDialogActions () {
- const cancelBtn = (
- }
- key='cancel'
- label={
-
- }
- onClick={ this.onClose }
- />
- );
-
- const confirmBtn = (
- }
- key='save'
- label={
-
- }
- disabled={ !!this.state.nameError }
- onClick={ this.onSave }
- />
- );
-
- return [ cancelBtn, confirmBtn ];
- }
-
- onClose = () => {
- this.props.onClose();
- }
-
- onSave = () => {
- const { name } = this.state;
- const { sourcecode } = this.props;
-
- this.props.onSave({ name, sourcecode });
- this.onClose();
- }
-
- onChangeName = (event, value) => {
- const { name, nameError } = validateName(value);
-
- this.setState({ name, nameError });
- }
-}
diff --git a/js/packages/dapp-develop/api.js b/js/packages/dapp-develop/api.js
deleted file mode 100644
index b2e52cca0..000000000
--- a/js/packages/dapp-develop/api.js
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import Api from '@parity/api';
-
-const ethereumProvider = window.ethereum || window.parent.ethereum;
-
-if (!ethereumProvider) {
- throw new Error('Unable to locate EthereumProvider, object not attached');
-}
-
-export default new Api(ethereumProvider);
diff --git a/js/packages/dapp-develop/contractDevelop.css b/js/packages/dapp-develop/contractDevelop.css
deleted file mode 100644
index d471f4a81..000000000
--- a/js/packages/dapp-develop/contractDevelop.css
+++ /dev/null
@@ -1,198 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.outer, .page, .editor {
- flex: 1;
- display: flex;
- flex-direction: column;
-}
-
-.timestamp {
- font-size: 0.75em;
- margin-left: 1em;
- color: #ccc;
-}
-
-.toggles {
- display: flex;
- flex-direction: row;
- margin: 1em 0 0;
-
- > * {
- flex: 1;
- }
-}
-
-.container {
- padding: 1em 0;
- display: flex;
- flex: 1;
- flex-direction: row;
-
- // Fallback for browsers not supporting `calc`
- min-height: 90vh;
- min-height: calc(100vh - 8em);
-
- > * {
- margin: 0;
-
- > h2 {
- margin-top: 0;
- }
- }
-}
-
-.error {
- background-color: rgba(200, 0, 0, 0.25);
- padding: 1em 0.5em;
- margin-top: -0.5em;
- font-family: monospace;
- font-size: 0.9em;
-}
-
-.mainEditor {
- &:global(.ace-solarized-dark) {
- background-color: rgba(0, 0, 0, 0.5);
-
- :global(.ace_gutter) {
- background-color: rgba(0, 0, 0, 0.7);
- }
-
- :global(.ace_content) {
- background-color: transparent;
- }
- }
-}
-
-.big {
- font-size: 1.2em;
-}
-
-.centeredMessage {
- width: 100%;
- height: 75%;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
-}
-
-.resizing * {
- cursor: ew-resize !important;
- user-select: none !important;
-}
-
-.editor {
- width: 0;
- margin-left: 0.5em;
-}
-
-.parameters {
- width: 0;
- display: flex;
- flex-direction: column;
- margin-right: 0.5em;
- overflow: auto;
-
- .panel {
- padding: 1em;
- flex: 1;
- display: flex;
- flex-direction: column;
- box-sizing: border-box;
- }
-
- .compilation {
- flex: 1 0 0;
- display: flex;
- flex-direction: column;
- }
-
- .errors {
- flex: 1 0 0;
- overflow: auto;
- margin-right: -0.5em;
- margin-top: 0.5em;
- }
-}
-
-.messageContainer {
- padding: 0.5em 0;
- margin-right: 0.5em;
-
- &:first-child {
- padding-top: 0;
- }
-
- &:last-child {
- padding-bottom: 0;
- }
-
- .errorPosition {
- background-color: rgba(0, 0, 0, 0.5);
- padding: 0.25em 0.5em;
- top: 0;
- position: relative;
- margin-bottom: 0.25em;
- font-size: 0.75em;
- }
-}
-
-.message {
- font-family: monospace;
- padding: 0.5em;
- font-size: 0.9em;
- white-space: pre;
- overflow: auto;
-
- &.error {
- background-color: rgba(244, 67, 54, 0.5);
- }
-
- &.warning {
- background-color: rgba(255, 235, 59, 0.5);
- }
-
- &.formal {
- background-color: rgba(243, 156, 18, 0.5);
- }
-}
-
-.messagesHeader {
- margin-bottom: 0.25em;
- text-transform: uppercase;
- font-size: 0.9em;
-}
-
-.sliderContainer {
- flex: 0 0 .8em;
- display: flex;
- align-items: center;
- justify-content: center;
-
- .slider {
- width: 0.4em;
- height: 3em;
- border-radius: 0.75em;
- background-color: rgba(0, 0, 0, 0.5);
- content: ' ';
-
- &:hover {
- cursor: ew-resize;
- }
- }
-}
diff --git a/js/packages/dapp-develop/contractDevelop.js b/js/packages/dapp-develop/contractDevelop.js
deleted file mode 100644
index bb001aa80..000000000
--- a/js/packages/dapp-develop/contractDevelop.js
+++ /dev/null
@@ -1,800 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-import { observer } from 'mobx-react';
-import { connect } from 'react-redux';
-import moment from 'moment';
-import { throttle } from 'lodash';
-
-import { Actionbar, ActionbarExport, ActionbarImport, Button, Dropdown, Input, Loading, Page, Toggle, Tab } from '@parity/ui';
-import { CancelIcon, ListIcon, SaveIcon, SendIcon, SettingsIcon } from '@parity/ui/Icons';
-import Editor from '@parity/ui/Editor';
-
-import DeployContract from '@parity/dapp-contracts/DeployContract';
-import LoadContract from './LoadContract';
-import SaveContract from './SaveContract';
-
-import ContractDevelopStore from './store';
-import styles from './contractDevelop.css';
-
-import { Debugger, TransactButton, Contract, DropdownBond } from 'parity-reactive-ui';
-import { Bond } from 'oo7';
-import { bonds } from 'oo7-parity';
-
-const traceOptions = [{ text: 'trace', value: 'trace' }, { text: 'vmTrace', value: 'vmTrace' }, { text: 'stateDiff', value: 'stateDiff' }];
-
-@observer
-class ContractDevelop extends Component {
- static propTypes = {
- accounts: PropTypes.object.isRequired,
- worker: PropTypes.object,
- workerError: PropTypes.any
- };
-
- store = ContractDevelopStore.get();
-
- state = {
- resizing: false,
- size: 65
- };
-
- debugDeploy = this.debugDeploy.bind(this);
-
- componentWillMount () {
- const { worker } = this.props;
-
- if (worker !== undefined) {
- this.store.setWorker(worker);
- }
- this.throttledResize = throttle(this.applyResize, 100, { leading: true });
- }
-
- componentDidMount () {
- this.store.setEditor(this.refs.editor);
-
- if (this.props.workerError) {
- this.store.setWorkerError(this.props.workerError);
- }
-
- // Wait for editor to be loaded
- window.setTimeout(() => {
- this.store.resizeEditor();
- }, 2000);
- }
-
- // Set the worker if not set before (eg. first page loading)
- componentWillReceiveProps (nextProps) {
- if (this.props.worker === undefined && nextProps.worker !== undefined) {
- this.store.setWorker(nextProps.worker);
- }
-
- if (this.props.workerError !== nextProps.workerError) {
- this.store.setWorkerError(nextProps.workerError);
- }
- }
-
- render () {
- console.log('render contractDevelopment');
- const { sourcecode } = this.store;
- const { size, resizing } = this.state;
-
- const annotations = this.store.annotations
- .slice()
- .filter((a) => a.contract === '');
-
- const panes = [
- { menuItem: 'Parameters', render: () =>
- );
- }
-
- handleStartResize = () => {
- this.setState({ resizing: true });
- }
-
- handleStopResize = () => {
- this.setState({ resizing: false });
- }
-
- handleResize = (event) => {
- if (!this.state.resizing) {
- return;
- }
-
- const { pageX, currentTarget } = event;
- const { width, left } = currentTarget.getBoundingClientRect();
-
- const x = pageX - left;
-
- this.size = 100 * x / width;
- this.throttledResize();
-
- event.stopPropagation();
- }
-
- applyResize = () => {
- this.setState({ size: this.size });
- }
-}
-
-function mapStateToProps (state) {
- const { accounts } = state.personal;
- const { worker, error } = state.worker;
-
- return {
- accounts,
- worker,
- workerError: error
- };
-}
-
-export default connect(
-mapStateToProps,
-null
-)(ContractDevelop);
diff --git a/js/packages/dapp-develop/index.js b/js/packages/dapp-develop/index.js
deleted file mode 100644
index 83b5710e5..000000000
--- a/js/packages/dapp-develop/index.js
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import ReactDOM from 'react-dom';
-import React from 'react';
-import { Route, Router, hashHistory } from 'react-router';
-
-import injectTapEventPlugin from 'react-tap-event-plugin';
-injectTapEventPlugin();
-
-import { initStore } from '@parity/shared/redux';
-import ContextProvider from '@parity/ui/ContextProvider';
-
-import api from './api';
-
-import ContractDevelop from './contractDevelop';
-
-const store = initStore(api, hashHistory);
-
-ReactDOM.render(
-
-
-
-
- ,
- document.querySelector('#container')
-);
diff --git a/js/packages/dapp-develop/package.json b/js/packages/dapp-develop/package.json
deleted file mode 100644
index 759c27e08..000000000
--- a/js/packages/dapp-develop/package.json
+++ /dev/null
@@ -1,25 +0,0 @@
-{
- "name": "@parity/dapp-develop",
- "description": "Parity contract development interface",
- "version": "1.99.99",
- "main": "index.js",
- "author": "Parity Team ",
- "maintainers": [],
- "contributors": [],
- "license": "GPL-3.0",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/paritytech/dapp-develop.git"
- },
- "keywords": [],
- "scripts": {},
- "devDependencies": {},
- "dependencies": {
- "@parity/parity.js": "1.8.7",
- "oo7": "0.5.3",
- "oo7-parity": "0.6.8",
- "oo7-react": "0.4.5",
- "parity-reactive-ui": "0.4.5"
- },
- "peerDependencies": {}
-}
diff --git a/js/packages/dapp-develop/store.js b/js/packages/dapp-develop/store.js
deleted file mode 100644
index 82d2e7721..000000000
--- a/js/packages/dapp-develop/store.js
+++ /dev/null
@@ -1,572 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { debounce } from 'lodash';
-import { action, computed, observable, transaction } from 'mobx';
-import React from 'react';
-import { FormattedMessage } from 'react-intl';
-import store from 'store';
-
-import { sha3 } from '@parity/api/util/sha3';
-import SolidityUtils from '@parity/shared/util/solidity';
-
-const SOLIDITY_LIST_URL = 'https://rawgit.com/ethereum/solc-bin/gh-pages/bin/list.json';
-const WRITE_CONTRACT_STORE_KEY = '_parity::contractDevelop';
-
-const SNIPPETS = {
- snippet0: {
- name: 'Token.sol',
- description: (
-
- ),
- id: 'snippet0',
- sourcecode: require('raw-loader!@parity/shared/contracts/snippets/token.sol')
- },
- snippet1: {
- name: 'StandardToken.sol',
- description: (
-
- ),
- id: 'snippet1',
- sourcecode: require('raw-loader!@parity/shared/contracts/snippets/standard-token.sol')
- },
- snippet2: {
- name: 'HumanStandardToken.sol',
- description: (
-
- ),
- id: 'snippet2',
- sourcecode: require('raw-loader!@parity/shared/contracts/snippets/human-standard-token.sol')
- },
- snippet3: {
- name: 'Wallet.sol',
- description: (
-
- ),
- id: 'snippet3',
- sourcecode: require('raw-loader!@parity/shared/contracts/snippets/wallet.sol')
- }
-};
-
-let instance = null;
-
-export default class ContractDevelopStore {
- @observable sourcecode = '';
-
- @observable compiled = false;
- @observable compiling = false;
- @observable loading = true;
-
- @observable contractIndex = -1;
- @observable contract = null;
- @observable contracts = {};
-
- @observable errors = [];
- @observable annotations = [];
-
- @observable builds = [];
- @observable selectedBuild = -1;
-
- @observable autocompile = false;
- @observable optimize = false;
-
- @observable showDeployModal = false;
- @observable showSaveModal = false;
- @observable showLoadModal = false;
-
- @observable savedContracts = {};
- @observable selectedContract = {};
-
- @observable workerError = null;
-
- loadingSolidity = false;
- lastCompilation = {};
- snippets = SNIPPETS;
- worker = undefined;
-
- useWorker = true;
- solc = {};
-
- constructor () {
- this.debouncedCompile = debounce(this.handleCompile, 1000);
- }
-
- static get () {
- if (!instance) {
- instance = new ContractDevelopStore();
- }
-
- return instance;
- }
-
- @action setWorkerError (error) {
- this.workerError = error;
- }
-
- @action setEditor (editor) {
- this.editor = editor;
- }
-
- @action setWorker (worker) {
- if (this.worker !== undefined) {
- return;
- }
-
- this.worker = worker;
-
- return Promise.all([
- this.fetchSolidityVersions().then(() => this.handleCompile()),
- this.reloadContracts(undefined, undefined, false)
- ]);
- }
-
- fetchSolidityVersions () {
- return fetch(SOLIDITY_LIST_URL)
- .then((response) => response.json())
- .then((data) => {
- const { builds, releases, latestRelease } = data;
- let latestIndex = -1;
- let promise = Promise.resolve();
-
- this.builds = builds.reverse().map((build, index) => {
- if (releases[build.version] === build.path) {
- build.release = true;
-
- if (build.version === latestRelease) {
- build.latest = true;
- promise = promise.then(() => this.loadSolidityVersion(build));
- latestIndex = index;
- }
- }
-
- return build;
- });
-
- this.selectedBuild = latestIndex;
- return promise;
- })
- .catch((error) => {
- this.setWorkerError(error);
- });
- }
-
- @action handleImport = (sourcecode) => {
- this.reloadContracts(-1, sourcecode);
- }
-
- @action handleSelectBuild = (event, value) => {
- this.selectedBuild = value;
- return this
- .loadSolidityVersion(this.builds[value])
- .then(() => this.handleCompile());
- }
-
- getCompiler (build) {
- const { longVersion } = build;
-
- if (!this.solc[longVersion]) {
- this.solc[longVersion] = SolidityUtils
- .getCompiler(build)
- .then((compiler) => {
- this.solc[longVersion] = compiler;
- return compiler;
- })
- .catch((error) => {
- this.setWorkerError(error);
- throw error;
- });
- }
-
- return Promise.resolve(this.solc[longVersion]);
- }
-
- @action loadSolidityVersion = (build) => {
- if (this.worker === undefined) {
- return;
- } else if (this.worker === null) {
- this.useWorker = false;
- }
-
- if (this.loadingSolidity) {
- return this.loadingSolidity;
- }
-
- this.loading = true;
-
- if (this.useWorker) {
- this.loadingSolidity = this.worker
- .postMessage({
- action: 'load',
- data: build
- })
- .then((result) => {
- if (result !== 'ok') {
- throw new Error('error while loading solidity: ' + result);
- }
-
- this.loadingSolidity = false;
- this.loading = false;
- })
- .catch((error) => {
- console.warn('error while loading solidity', error);
- this.useWorker = false;
- this.loadingSolidity = null;
-
- return this.loadSolidityVersion(build);
- });
- } else {
- this.loadingSolidity = this
- .getCompiler(build)
- .then(() => {
- this.loadingSolidity = false;
- this.loading = false;
-
- return 'ok';
- })
- .catch((error) => {
- this.setWorkerError(error);
- this.loadingSolidity = false;
- this.loading = false;
- });
- }
-
- return this.loadingSolidity;
- }
-
- @action handleOpenDeployModal = () => {
- this.showDeployModal = true;
- }
-
- @action handleCloseDeployModal = () => {
- this.showDeployModal = false;
- }
-
- @action handleOpenLoadModal = () => {
- this.showLoadModal = true;
- }
-
- @action handleCloseLoadModal = () => {
- this.showLoadModal = false;
- }
-
- @action handleOpenSaveModal = () => {
- this.showSaveModal = true;
- }
-
- @action handleCloseSaveModal = () => {
- this.showSaveModal = false;
- }
-
- @action handleSelectContract = (event, value) => {
- this.contractIndex = value;
- this.contract = this.contracts[Object.keys(this.contracts)[value]];
- }
-
- compile = (data) => {
- const { name = '' } = this.selectedContract;
-
- if (this.useWorker) {
- return this.worker.postMessage({
- action: 'compile',
- data: {
- ...data,
- name
- }
- });
- }
-
- return new Promise((resolve, reject) => {
- window.setTimeout(() => {
- this
- .getCompiler(data.build)
- .then((compiler) => {
- return SolidityUtils.compile({
- ...data,
- name
- }, compiler);
- })
- .then(resolve)
- .catch(reject);
- }, 0);
- });
- }
-
- @computed get isPristine () {
- return this.getHash() === this.lastCompilation.hash;
- }
-
- getHash () {
- const build = this.builds[this.selectedBuild];
- const version = build.longVersion;
- const sourcecode = this.sourcecode.replace(/\s+/g, ' ');
-
- return sha3(JSON.stringify({ version, sourcecode, optimize: this.optimize }));
- }
-
- @action handleCompile = () => {
- transaction(() => {
- this.compiled = false;
- this.compiling = true;
- this.setWorkerError(null);
- });
-
- const build = this.builds[this.selectedBuild];
- const hash = this.getHash();
-
- let promise = Promise.resolve(null);
-
- if (hash === this.lastCompilation.hash) {
- promise = new Promise((resolve) => {
- window.setTimeout(() => {
- resolve(this.lastCompilation);
- }, 500);
- });
- } else {
- promise = this
- .compile({
- sourcecode: this.sourcecode,
- build: build,
- optimize: this.optimize,
- files: this.files
- })
- .then((data) => {
- const result = this.parseCompiled(data);
-
- this.lastCompilation = {
- result: result,
- date: new Date(),
- version: data.version,
- hash
- };
-
- return this.lastCompilation;
- })
- .catch((error) => {
- this.setWorkerError(error);
- });
- }
-
- return promise.then((data = null) => {
- if (data) {
- const {
- contract, contractIndex,
- annotations, contracts, errors
- } = data.result;
-
- if (!contract && errors && errors.length > 0) {
- this.setWorkerError(errors[0]);
- } else {
- this.contract = contract;
- this.contractIndex = contractIndex;
-
- this.annotations = annotations;
- this.contracts = contracts;
- this.errors = errors;
- }
- }
-
- this.compiled = true;
- this.compiling = false;
- });
- }
-
- @action handleAutocompileToggle = () => {
- this.autocompile = !this.autocompile;
- }
-
- @action handleOptimizeToggle = () => {
- this.optimize = !this.optimize;
- }
-
- @action parseCompiled = (data) => {
- const { contracts } = data;
-
- const { errors = [] } = data;
- const errorAnnotations = this.parseErrors(errors);
- // const formalAnnotations = this.parseErrors(data.formal && data.formal.errors, true);
-
- const annotations = [].concat(
- errorAnnotations
- );
-
- const contractKeys = Object.keys(contracts || {});
-
- const contract = contractKeys.length ? contracts[contractKeys[0]] : null;
- const contractIndex = contractKeys.length ? 0 : -1;
-
- return {
- contract, contractIndex,
- contracts, errors, annotations
- };
- }
-
- parseErrors = (data, formal = false) => {
- const regex = /^(.*):(\d+):(\d+):\s*([a-z]+):\s*((.|[\r\n])+)$/i;
-
- return (data || [])
- .filter((e) => regex.test(e))
- .map((error, index) => {
- const match = regex.exec(error);
-
- const contract = match[1];
- const row = parseInt(match[2]) - 1;
- const column = parseInt(match[3]);
-
- const type = formal ? 'warning' : match[4].toLowerCase();
- const text = match[5];
-
- return {
- contract,
- row, column,
- type, text,
- formal
- };
- });
- }
-
- @action handleEditSourcecode = (value, compile = false) => {
- this.sourcecode = value;
-
- const localStore = store.get(WRITE_CONTRACT_STORE_KEY) || {};
-
- store.set(WRITE_CONTRACT_STORE_KEY, {
- ...localStore,
- current: value
- });
-
- if (compile) {
- this.handleCompile();
- } else if (this.autocompile) {
- this.debouncedCompile();
- }
- }
-
- @action handleSaveContract = () => {
- if (this.selectedContract && this.selectedContract.id !== undefined) {
- return this.handleSaveNewContract({
- ...this.selectedContract,
- sourcecode: this.sourcecode
- });
- }
-
- return this.handleOpenSaveModal();
- }
-
- getId (contracts) {
- return Object.values(contracts)
- .map((c) => c.id)
- .reduce((max, id) => Math.max(max, id), 0) + 1;
- }
-
- @action handleSaveNewContract = (data) => {
- const { name, sourcecode, id } = data;
-
- const localStore = store.get(WRITE_CONTRACT_STORE_KEY) || {};
- const savedContracts = localStore.saved || {};
- const cId = (id !== undefined)
- ? id
- : this.getId(savedContracts);
-
- store.set(WRITE_CONTRACT_STORE_KEY, {
- ...localStore,
- saved: {
- ...savedContracts,
- [ cId ]: { sourcecode, id: cId, name, timestamp: Date.now() }
- }
- });
-
- this.reloadContracts(cId);
- }
-
- @action reloadContracts = (id, sourcecode, recompile = true) => {
- const localStore = store.get(WRITE_CONTRACT_STORE_KEY) || {};
-
- this.savedContracts = localStore.saved || {};
-
- const cId = id !== undefined ? id : localStore.currentId;
-
- this.selectedContract = this.savedContracts[cId] || {};
- this.sourcecode = sourcecode !== undefined
- ? sourcecode
- : this.selectedContract.sourcecode || localStore.current || '';
-
- store.set(WRITE_CONTRACT_STORE_KEY, {
- ...localStore,
- currentId: this.selectedContract ? cId : null,
- current: this.sourcecode
- });
-
- this.resizeEditor();
-
- if (recompile) {
- return this.handleCompile();
- }
- }
-
- @action handleLoadContract = (contract) => {
- const { sourcecode, id } = contract;
-
- this.reloadContracts(id, sourcecode);
- }
-
- @action handleDeleteContract = (id) => {
- const localStore = store.get(WRITE_CONTRACT_STORE_KEY) || {};
-
- const savedContracts = Object.assign({}, localStore.saved || {});
-
- if (savedContracts[id]) {
- delete savedContracts[id];
- }
-
- store.set(WRITE_CONTRACT_STORE_KEY, {
- ...localStore,
- saved: savedContracts
- });
-
- this.reloadContracts();
- }
-
- @action handleNewContract = () => {
- this.reloadContracts(-1, '');
- }
-
- @action resizeEditor = () => {
- try {
- this.editor.refs.brace.editor.resize();
- } catch (e) {}
- }
-
- get files () {
- const files = [].concat(
- Object.values(this.snippets),
- Object.values(this.savedContracts)
- );
-
- return files;
- }
-}
diff --git a/js/packages/dapp-develop/webpack_config_parityjs.js b/js/packages/dapp-develop/webpack_config_parityjs.js
deleted file mode 100644
index cfb609ff2..000000000
--- a/js/packages/dapp-develop/webpack_config_parityjs.js
+++ /dev/null
@@ -1,276 +0,0 @@
-
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-const webpack = require('webpack');
-const path = require('path');
-// const ReactIntlAggregatePlugin = require('react-intl-aggregate-webpack-plugin');
-const WebpackErrorNotificationPlugin = require('webpack-error-notification');
-const CopyWebpackPlugin = require('copy-webpack-plugin');
-const HtmlWebpackPlugin = require('html-webpack-plugin');
-const ExtractTextPlugin = require('extract-text-webpack-plugin');
-const ServiceWorkerWebpackPlugin = require('serviceworker-webpack-plugin');
-const ScriptExtHtmlWebpackPlugin = require('script-ext-html-webpack-plugin');
-
-const rulesEs6 = require('./rules/es6');
-const rulesParity = require('./rules/parity');
-const Shared = require('./shared');
-
-const DAPPS_BUILTIN = require('../packages/shared/config/dappsBuiltin.json');
-const DAPPS_VIEWS = require('../packages/shared/config/dappsViews.json').map((dapp) => {
- dapp.commons = true;
- return dapp;
-});
-
-const FAVICON = path.resolve(__dirname, '../packages/shared/assets/images/parity-logo-black-no-text.png');
-
-const DEST = process.env.BUILD_DEST || '.build';
-const ENV = process.env.NODE_ENV || 'development';
-const EMBED = process.env.EMBED;
-
-const isProd = ENV === 'production';
-const isEmbed = EMBED === '1' || EMBED === 'true';
-const isAnalize = process.env.WPANALIZE === '1';
-
-const entry = isEmbed
- ? {
- embed: './embed.js'
- }
- : Object.assign({}, Shared.dappsEntry, {
- index: './index.js'
- });
-
-module.exports = {
- cache: !isProd,
- devtool: isProd ? '#hidden-source-map' : '#source-map',
-
- context: path.join(__dirname, '../src'),
- entry: entry,
- output: {
- // publicPath: '/',
- path: path.join(__dirname, '../', DEST),
- filename: '[name].[hash:10].js'
- },
-
- module: {
- rules: [
- rulesParity,
- rulesEs6,
- {
- test: /\.js$/,
- exclude: /(node_modules)/,
- use: [ 'happypack/loader?id=babel-js' ]
- },
- {
- test: /\.json$/,
- use: [ 'json-loader' ]
- },
- {
- test: /\.ejs$/,
- use: [ 'ejs-loader' ]
- },
- {
- test: /\.html$/,
- use: [
- 'file-loader?name=[name].[ext]!extract-loader',
- {
- loader: 'html-loader',
- options: {
- root: path.resolve(__dirname, '../assets/images'),
- attrs: ['img:src', 'link:href']
- }
- }
- ]
- },
- {
- test: /\.md$/,
- use: [
- {
- loader: 'html-loader',
- options: {}
- },
- {
- loader: 'markdown-loader',
- options: {}
- }
- ]
- },
- {
- test: /\.css$/,
- include: [ /packages/, /src/ ],
- loader: (isProd && !isEmbed)
- ? ExtractTextPlugin.extract([
- // 'style-loader',
- 'css-loader?modules&sourceMap&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]',
- 'postcss-loader'
- ])
- : undefined,
- use: (isProd && !isEmbed)
- ? undefined
- : [ 'happypack/loader?id=css' ]
- },
-
- {
- test: /\.css$/,
- exclude: [ /packages/, /src/ ],
- use: [ 'style-loader', 'css-loader' ]
- },
- {
- test: /\.(png|jpg)$/,
- use: [ 'file-loader?&name=assets/[name].[hash:10].[ext]' ]
- },
- {
- test: /\.(woff|woff2|ttf|eot|otf)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
- use: [ 'file-loader?name=fonts/[name][hash:10].[ext]' ]
- },
- {
- test: /parity-logo-white-no-text\.svg/,
- use: [ 'url-loader' ]
- },
- {
- test: /\.svg(\?v=[0-9]\.[0-9]\.[0-9])?$/,
- exclude: [ /parity-logo-white-no-text\.svg/ ],
- use: [ 'file-loader?name=assets/[name].[hash:10].[ext]' ]
- }
- ],
- noParse: [
- /node_modules\/sinon/
- ]
- },
-
- resolve: {
- alias: {
- '~/packages/api/local': path.resolve(__dirname, '../packages/api/local/localAccountsMiddleware.js'),
- '~': path.resolve(__dirname, '..'),
- '@parity/wordlist': path.resolve(__dirname, '../node_modules/@parity/wordlist'),
- '@parity': path.resolve(__dirname, '../packages'),
- '@parity/parity.js': path.resolve(__dirname, '../src/library.parity.js'),
- 'oo7-parity': path.resolve(__dirname, '../oo7-parity'),
- 'oo7-react': path.resolve(__dirname, '../oo7-react'),
- 'oo7': path.resolve(__dirname, '../oo7'),
- 'parity-reactive-ui': path.resolve(__dirname, '../parity-reactive-ui')
- },
- modules: [
- path.join(__dirname, '../node_modules')
- ],
- extensions: ['.json', '.js', '.jsx'],
- unsafeCache: true
- },
-
- node: {
- fs: 'empty'
- },
-
- plugins: (function () {
- const DappsHTMLInjection = []
- .concat(DAPPS_BUILTIN, DAPPS_VIEWS)
- .filter((dapp) => !dapp.skipBuild)
- .map((dapp) => {
- return new HtmlWebpackPlugin({
- title: dapp.name,
- filename: dapp.url + '.html',
- template: '../packages/dapps/index.ejs',
- favicon: FAVICON,
- secure: dapp.secure,
- chunks: [ !isProd || dapp.commons ? 'commons' : null, dapp.url ]
- });
- });
-
- let plugins = Shared.getPlugins().concat(
- new WebpackErrorNotificationPlugin()
- );
-
- if (!isEmbed) {
- plugins = [].concat(
- plugins,
-
- new HtmlWebpackPlugin({
- title: 'Parity',
- filename: 'index.html',
- template: './index.ejs',
- favicon: FAVICON,
- chunks: [
- isProd ? null : 'commons',
- 'index'
- ]
- }),
-
- new ServiceWorkerWebpackPlugin({
- entry: path.join(__dirname, '../src/serviceWorker.js')
- }),
-
- DappsHTMLInjection,
-
- new webpack.DllReferencePlugin({
- context: '.',
- manifest: require(`../${DEST}/vendor-manifest.json`)
- }),
-
- new ScriptExtHtmlWebpackPlugin({
- sync: [ 'commons', 'vendor.js' ],
- defaultAttribute: 'defer'
- }),
-
- new CopyWebpackPlugin([
- { from: './error_pages.css', to: 'styles.css' },
- { from: '../packages/dapps/static' }
- ], {})
- );
- }
-
- if (isEmbed) {
- plugins.push(
- new HtmlWebpackPlugin({
- title: 'Parity Bar',
- filename: 'embed.html',
- template: './index.ejs',
- favicon: FAVICON,
- chunks: [
- isProd ? null : 'commons',
- 'embed'
- ]
- })
- );
- }
-
- if (!isAnalize && !isProd) {
- // const DEST_I18N = path.join(__dirname, '..', DEST, 'i18n');
-
- plugins.push(
- // new ReactIntlAggregatePlugin({
- // messagesPattern: DEST_I18N + '/i18n/**/*.json',
- // aggregateOutputDir: DEST_I18N + '/i18n/',
- // aggregateFilename: 'en'
- // }),
-
- new webpack.optimize.CommonsChunkPlugin({
- filename: 'commons.[hash:10].js',
- name: 'commons',
- minChunks: 2
- })
- );
- }
-
- if (isProd) {
- plugins.push(new ExtractTextPlugin({
- filename: 'styles/[name].[hash:10].css',
- allChunks: true
- }));
- }
-
- return plugins;
- }())
-};
diff --git a/js/packages/dapp-githubhint/Application/application.css b/js/packages/dapp-githubhint/Application/application.css
deleted file mode 100644
index 7efe34da3..000000000
--- a/js/packages/dapp-githubhint/Application/application.css
+++ /dev/null
@@ -1,160 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.body {
- text-align: center;
- background: #333;
- color: #fff;
-}
-
-.container {
- vertical-align: middle;
- padding: 4em 0;
- margin: 0 0 2em 0;
-}
-
-.form {
- text-align: right;
- margin: 0 auto;
- border-radius: 5px;
- width: 44em;
- color: #eee;
-}
-
-.box {
- padding: 2em;
- background: rgba(255, 255, 255, 0.1);
- border-radius: 5px;
- margin-bottom: 2em;
-}
-
-.buttons {
- text-align: center;
- margin: 0 auto 2em auto;
-}
-
-.box .buttons {
- text-align: right;
- margin: 2em 0 0 0;
- position: relative;
-}
-
-.box .buttons .addressSelect {
- position: absolute;
- top: 0;
- left: 0;
-}
-
-.box .description {
- margin: 0 0 2em 0;
- text-align: center;
- opacity: 0.75;
-}
-
-.progress {
- margin: 2em 0 0 0;
- opacity: 0.75;
- text-align: center;
-}
-
-.statusHeader {
- font-size: 1em;
-}
-
-.statusState, .statusError {
- padding: 1em 0 0 0;
-}
-
-.statusError {
- color: #f66;
-}
-
-.capture {
-}
-
-.capture+.capture {
- margin-top: 0.5em;
-}
-
-.capture * {
- display: inline-block;
- padding: 0.75em;
- vertical-align: middle;
- box-sizing: border-box;
- width: 20em;
-}
-
-.capture input {
- color: #333;
- background: #eee;
- border: none;
- border-radius: 0.5em;
- width: 100%;
- font-size: 1em;
- text-align: center;
-}
-
-.capture input[disabled] {
- opacity: 0.5;
-}
-
-.capture input.error {
- background: #fcc;
-}
-
-.hashError, .hashWarning, .hashOk {
- margin: 0.5em 0;
- text-align: center;
- padding: 1em 0;
- border: 0.25em solid #333;
- border-radius: 0.5em;
-}
-
-.hashError {
- border-color: #f66;
- color: #f66;
- background: rgba(255, 102, 102, 0.25);
-}
-
-.hashWarning {
- border-color: #f80;
- color: #f80;
- background: rgba(255, 236, 0, 0.25);
-}
-
-.hashOk {
- border-color: #6f6;
- color: #6f6;
- background: rgba(102, 255, 102, 0.25);
-}
-
-.typeButtons {
- text-align: center;
- padding: 0 0 1em 0;
-}
-
-.typeButtons>div {
- border-radius: 0 !important;
-
- &:first-child {
- border-radius: 5px 0 0 5px !important;
- }
-
- &:last-child {
- border-radius: 0 5px 5px 0 !important;
- }
-}
diff --git a/js/packages/dapp-githubhint/Application/application.js b/js/packages/dapp-githubhint/Application/application.js
deleted file mode 100644
index f09f9c2fa..000000000
--- a/js/packages/dapp-githubhint/Application/application.js
+++ /dev/null
@@ -1,521 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-
-import { api } from '../parity';
-import { attachInterface, subscribeDefaultAddress, unsubscribeDefaultAddress } from '../services';
-import Button from '../Button';
-import Events from '../Events';
-import Loading from '../Loading';
-
-import styles from './application.css';
-
-const INVALID_URL_HASH = '0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470';
-const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';
-
-let nextEventId = 0;
-
-export default class Application extends Component {
- state = {
- defaultAddress: null,
- loading: true,
- url: '',
- urlError: null,
- commit: '',
- commitError: null,
- contentHash: '',
- contentHashError: null,
- contentHashOwner: null,
- registerBusy: false,
- registerError: null,
- registerState: '',
- registerType: 'file',
- repo: '',
- repoError: null,
- subscriptionId: null,
- events: {},
- eventIds: []
- }
-
- componentDidMount () {
- return Promise
- .all([
- attachInterface(),
- subscribeDefaultAddress((error, defaultAddress) => {
- if (!error) {
- this.setState({ defaultAddress });
- }
- })
- ])
- .then(([state]) => {
- this.setState(Object.assign({}, state, {
- loading: false
- }));
- });
- }
-
- componentWillUnmount () {
- return unsubscribeDefaultAddress();
- }
-
- render () {
- const { loading } = this.state;
-
- return loading
- ? this.renderLoading()
- : this.renderPage();
- }
-
- renderLoading () {
- return (
-
- );
- }
-
- renderPage () {
- const { defaultAddress, registerBusy, url, urlError, contentHash, contentHashError, contentHashOwner, commit, commitError, registerType, repo, repoError } = this.state;
-
- let hashClass = null;
-
- if (contentHashError) {
- hashClass = contentHashOwner !== defaultAddress
- ? styles.hashError
- : styles.hashWarning;
- } else if (contentHash) {
- hashClass = styles.hashOk;
- }
-
- let valueInputs = null;
-
- if (registerType === 'content') {
- valueInputs = [
-
-
-
,
-
-
-
- ];
- } else {
- valueInputs = (
-
-
-
- );
- }
-
- return (
-
-
-
-
-
-
-
-
-
- Provide a valid URL to register. The content information can be used in other contracts that allows for reverse lookups, e.g. image registries, dapp registries, etc.
-
- );
- }
-
- onClickTypeNormal = () => {
- const { url } = this.state;
-
- this.setState({ registerType: 'file', commitError: null, repoError: null }, () => {
- this.onChangeUrl({ target: { value: url } });
- });
- }
-
- onClickTypeContent = () => {
- const { repo, commit } = this.state;
-
- this.setState({ registerType: 'content', urlError: null }, () => {
- this.onChangeRepo({ target: { value: repo } });
- this.onChangeCommit({ target: { value: commit } });
- });
- }
-
- onChangeCommit = (event) => {
- let commit = event.target.value;
- const commitError = null;
- let hasContent = false;
-
- this.setState({ commit, commitError, contentHashError: null }, () => {
- const { repo } = this.state || '';
- const parts = repo.split('/');
-
- hasContent = commit.length !== 0 && parts.length === 2 && parts[0].length !== 0 && parts[1].length !== 0;
- if (!commitError && hasContent) {
- this.setState({ contentHashError: 'hash lookup in progress' });
- this.lookupHash(`https://codeload.github.com/${repo}/zip/${commit}`);
- }
- });
- }
-
- onChangeRepo = (event) => {
- let repo = event.target.value;
- const repoError = null;
- let hasContent = false;
-
- // TODO: field validation
- if (!repoError) {
- repo = repo.replace('https://github.com/', '');
- }
-
- this.setState({ repo, repoError, contentHashError: null }, () => {
- const { commit } = this.state || '';
- const parts = repo.split('/');
-
- hasContent = commit.length !== 0 && parts.length === 2 && parts[0].length !== 0 && parts[1].length !== 0;
- if (!repoError && hasContent) {
- this.setState({ contentHashError: 'hash lookup in progress' });
- this.lookupHash(`https://codeload.github.com/${repo}/zip/${commit}`);
- }
- });
- }
-
- onChangeUrl = (event) => {
- let url = event.target.value;
- const urlError = null;
- let hasContent = false;
-
- // TODO: field validation
- if (!urlError) {
- const parts = url.split('/');
-
- hasContent = parts.length !== 0;
-
- if (parts[2] === 'github.com' || parts[2] === 'raw.githubusercontent.com') {
- url = `https://raw.githubusercontent.com/${parts.slice(3).join('/')}`.replace('/blob/', '/');
- }
- }
-
- this.setState({ url, urlError, contentHashError: null }, () => {
- if (!urlError && hasContent) {
- this.setState({ contentHashError: 'hash lookup in progress' });
- this.lookupHash(url);
- }
- });
- }
-
- onClickRegister = () => {
- const { defaultAddress, commit, commitError, contentHashError, contentHashOwner, url, urlError, registerType, repo, repoError } = this.state;
-
- // TODO: No errors are currently set, validation to be expanded and added for each
- // field (query is fast to pick up the issues, so not burning atm)
- if ((contentHashError && contentHashOwner !== defaultAddress) || repoError || urlError || commitError) {
- return;
- }
-
- if (registerType === 'file') {
- this.registerUrl(url);
- } else {
- this.registerContent(repo, commit);
- }
- }
-
- trackRequest (eventId, promise) {
- return promise
- .then((signerRequestId) => {
- this.setState({
- events: Object.assign({}, this.state.events, {
- [eventId]: Object.assign({}, this.state.events[eventId], {
- signerRequestId,
- registerState: 'Transaction posted, Waiting for transaction authorization'
- })
- })
- });
-
- return api.pollMethod('parity_checkRequest', signerRequestId);
- })
- .then((txHash) => {
- this.setState({
- events: Object.assign({}, this.state.events, {
- [eventId]: Object.assign({}, this.state.events[eventId], {
- txHash,
- registerState: 'Transaction authorized, Waiting for network confirmations'
- })
- })
- });
-
- return api.pollMethod('eth_getTransactionReceipt', txHash, (receipt) => {
- if (!receipt || !receipt.blockNumber || receipt.blockNumber.eq(0)) {
- return false;
- }
-
- return true;
- });
- })
- .then((txReceipt) => {
- this.setState({
- events: Object.assign({}, this.state.events, {
- [eventId]: Object.assign({}, this.state.events[eventId], {
- txReceipt,
- registerBusy: false,
- registerState: 'Network confirmed, Received transaction receipt'
- })
- })
- });
- })
- .catch((error) => {
- console.error('onSend', error);
-
- this.setState({
- events: Object.assign({}, this.state.events, {
- [eventId]: Object.assign({}, this.state.events[eventId], {
- registerState: error.message,
- registerError: true,
- registerBusy: false
- })
- })
- });
- });
- }
-
- registerContent (contentRepo, contentCommit) {
- const { defaultAddress, contentHash, instance } = this.state;
-
- contentCommit = contentCommit.substr(0, 2) === '0x'
- ? contentCommit
- : `0x${contentCommit}`;
-
- const eventId = nextEventId++;
- const values = [contentHash, contentRepo, contentCommit];
- const options = { from: defaultAddress };
-
- this.setState({
- eventIds: [eventId].concat(this.state.eventIds),
- events: Object.assign({}, this.state.events, {
- [eventId]: {
- contentHash,
- contentRepo,
- contentCommit,
- defaultAddress,
- registerBusy: true,
- registerState: 'Estimating gas for the transaction',
- timestamp: new Date()
- }
- }),
- url: '',
- commit: '',
- repo: '',
- commitError: null,
- contentHash: '',
- contentHashOwner: null,
- contentHashError: null
- });
-
- this.trackRequest(
- eventId, instance
- .hint.estimateGas(options, values)
- .then((gas) => {
- this.setState({
- events: Object.assign({}, this.state.events, {
- [eventId]: Object.assign({}, this.state.events[eventId], {
- registerState: 'Gas estimated, Posting transaction to the network'
- })
- })
- });
-
- const gasPassed = gas.mul(1.2);
-
- options.gas = gasPassed.toFixed(0);
- console.log(`gas estimated at ${gas.toFormat(0)}, passing ${gasPassed.toFormat(0)}`);
-
- return instance.hint.postTransaction(options, values);
- })
- );
- }
-
- registerUrl (contentUrl) {
- const { contentHash, defaultAddress, instance } = this.state;
-
- const eventId = nextEventId++;
- const values = [contentHash, contentUrl];
- const options = { from: defaultAddress };
-
- this.setState({
- eventIds: [eventId].concat(this.state.eventIds),
- events: Object.assign({}, this.state.events, {
- [eventId]: {
- contentHash,
- contentUrl,
- defaultAddress,
- registerBusy: true,
- registerState: 'Estimating gas for the transaction',
- timestamp: new Date()
- }
- }),
- url: '',
- commit: '',
- repo: '',
- commitError: null,
- contentHash: '',
- contentHashOwner: null,
- contentHashError: null
- });
-
- this.trackRequest(
- eventId, instance
- .hintURL.estimateGas(options, values)
- .then((gas) => {
- this.setState({
- events: Object.assign({}, this.state.events, {
- [eventId]: Object.assign({}, this.state.events[eventId], {
- registerState: 'Gas estimated, Posting transaction to the network'
- })
- })
- });
-
- const gasPassed = gas.mul(1.2);
-
- options.gas = gasPassed.toFixed(0);
- console.log(`gas estimated at ${gas.toFormat(0)}, passing ${gasPassed.toFormat(0)}`);
-
- return instance.hintURL.postTransaction(options, values);
- })
- );
- }
-
- lookupHash (url) {
- const { instance } = this.state;
-
- if (!url || !url.length) {
- return;
- }
-
- console.log(`lookupHash ${url}`);
-
- api.parity
- .hashContent(url)
- .then((contentHash) => {
- console.log('lookupHash', contentHash);
- if (contentHash === INVALID_URL_HASH) {
- this.setState({ contentHashError: 'invalid url endpoint', contentHash: null });
- return;
- }
-
- instance.entries
- .call({}, [contentHash])
- .then(([accountSlashRepo, commit, contentHashOwner]) => {
- console.log('lookupHash', accountSlashRepo, api.util.bytesToHex(commit), contentHashOwner);
-
- if (contentHashOwner !== ZERO_ADDRESS) {
- this.setState({
- contentHashError: contentHash,
- contentHashOwner,
- contentHash
- });
- } else {
- this.setState({ contentHashError: null, contentHashOwner, contentHash });
- }
- });
- })
- .catch((error) => {
- console.error('lookupHash', error);
- this.setState({ contentHashError: error.message, contentHash: null });
- });
- }
-}
diff --git a/js/packages/dapp-githubhint/Application/index.js b/js/packages/dapp-githubhint/Application/index.js
deleted file mode 100644
index 3d8d1ca3b..000000000
--- a/js/packages/dapp-githubhint/Application/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './application';
diff --git a/js/packages/dapp-githubhint/Button/button.css b/js/packages/dapp-githubhint/Button/button.css
deleted file mode 100644
index c2f88ba77..000000000
--- a/js/packages/dapp-githubhint/Button/button.css
+++ /dev/null
@@ -1,56 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.button {
- background: #08a;
- color: white;
- border-radius: 5px;
- font-size: 1em;
- line-height: 24px;
- height: 24px;
- padding: 0.75em 1.5em;
- cursor: pointer;
- display: inline-block;
- text-align: center;
-}
-
-.button.first {
- border-radius: 5px 0 0 5px;
-}
-
-.button.middle {
- border-radius: 0;
-}
-
-.button.last {
- border-radius: 0 5px 5px 0;
-}
-
-.button.disabled {
- opacity: 0.25;
- cursor: default;
-}
-
-.button.inverse {
- color: #08a;
- background: white;
-}
-
-.button * {
- display: inline-block;
- vertical-align: top;
-}
diff --git a/js/packages/dapp-githubhint/Button/button.js b/js/packages/dapp-githubhint/Button/button.js
deleted file mode 100644
index a4c539ec2..000000000
--- a/js/packages/dapp-githubhint/Button/button.js
+++ /dev/null
@@ -1,54 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-
-import styles from './button.css';
-
-export default class Button extends Component {
- static propTypes = {
- children: PropTypes.node.isRequired,
- className: PropTypes.string,
- disabled: PropTypes.bool,
- invert: PropTypes.bool,
- first: PropTypes.bool,
- last: PropTypes.bool,
- middle: PropTypes.bool,
- onClick: PropTypes.func.isRequired
- }
-
- render () {
- const { children, className, disabled, invert, first, last, middle } = this.props;
- const classes = `${styles.button} ${disabled ? styles.disabled : ''} ${invert ? styles.inverse : ''} ${first ? styles.first : ''} ${last ? styles.last : ''} ${middle ? styles.middle : ''} ${className}`;
-
- return (
-
- { children }
-
- );
- }
-
- onClick = (event) => {
- const { disabled, onClick } = this.props;
-
- if (disabled) {
- return;
- }
-
- onClick(event);
- }
-}
diff --git a/js/packages/dapp-githubhint/Button/index.js b/js/packages/dapp-githubhint/Button/index.js
deleted file mode 100644
index 0c2be07ee..000000000
--- a/js/packages/dapp-githubhint/Button/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './button';
diff --git a/js/packages/dapp-githubhint/Events/events.css b/js/packages/dapp-githubhint/Events/events.css
deleted file mode 100644
index e83cb8f52..000000000
--- a/js/packages/dapp-githubhint/Events/events.css
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.list {
- border: none;
- margin: 0 auto;
- text-align: left;
- vertical-align: top;
-
- tr {
- &[data-busy="true"] {
- opacity: 0.5;
- }
-
- &[data-error="true"] {
- color: #f66;
- }
- }
-
- td {
- padding: 0.5em;
- }
-}
diff --git a/js/packages/dapp-githubhint/Events/events.js b/js/packages/dapp-githubhint/Events/events.js
deleted file mode 100644
index 12d01a7d9..000000000
--- a/js/packages/dapp-githubhint/Events/events.js
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import moment from 'moment';
-import PropTypes from 'prop-types';
-
-import styles from './events.css';
-
-export default class Events extends Component {
- static propTypes = {
- eventIds: PropTypes.array.isRequired,
- events: PropTypes.array.isRequired
- }
-
- render () {
- return (
-
- );
- }
-}
diff --git a/js/packages/dapp-githubhint/Events/index.js b/js/packages/dapp-githubhint/Events/index.js
deleted file mode 100644
index d2d0080b3..000000000
--- a/js/packages/dapp-githubhint/Events/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './events';
diff --git a/js/packages/dapp-githubhint/Loading/index.js b/js/packages/dapp-githubhint/Loading/index.js
deleted file mode 100644
index 5eb10a7d4..000000000
--- a/js/packages/dapp-githubhint/Loading/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './loading';
diff --git a/js/packages/dapp-githubhint/Loading/loading.css b/js/packages/dapp-githubhint/Loading/loading.css
deleted file mode 100644
index 36d792c7d..000000000
--- a/js/packages/dapp-githubhint/Loading/loading.css
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.loading {
- width: 100%;
- text-align: center;
- padding-top: 5em;
- font-size: 2em;
- color: #999;
-}
diff --git a/js/packages/dapp-githubhint/Loading/loading.js b/js/packages/dapp-githubhint/Loading/loading.js
deleted file mode 100644
index f716214d2..000000000
--- a/js/packages/dapp-githubhint/Loading/loading.js
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-
-import styles from './loading.css';
-
-export default class Loading extends Component {
- render () {
- return (
-
- Attaching to contract ...
-
- );
- }
-}
diff --git a/js/packages/dapp-githubhint/index.js b/js/packages/dapp-githubhint/index.js
deleted file mode 100644
index de98cb636..000000000
--- a/js/packages/dapp-githubhint/index.js
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import ReactDOM from 'react-dom';
-import React from 'react';
-import { AppContainer } from 'react-hot-loader';
-
-import injectTapEventPlugin from 'react-tap-event-plugin';
-injectTapEventPlugin();
-
-import Application from './Application';
-
-import '@parity/shared/assets/fonts/Roboto/font.css';
-import '@parity/shared/assets/fonts/RobotoMono/font.css';
-import '@parity/dapps/style.css';
-
-ReactDOM.render(
-
-
- ,
- document.querySelector('#container')
-);
-
-if (module.hot) {
- module.hot.accept('./Application/index.js', () => {
- require('./Application/index.js');
-
- ReactDOM.render(
-
-
- ,
- document.querySelector('#container')
- );
- });
-}
diff --git a/js/packages/dapp-githubhint/package.json b/js/packages/dapp-githubhint/package.json
deleted file mode 100644
index 60bab49b1..000000000
--- a/js/packages/dapp-githubhint/package.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "name": "@parity/dapp-githubhint",
- "description": "Parity dapps",
- "version": "1.99.99",
- "main": "index.js",
- "author": "Parity Team ",
- "maintainers": [],
- "contributors": [],
- "license": "GPL-3.0",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/paritytech/dapp-githubhint.git"
- },
- "keywords": [],
- "scripts": {},
- "devDependencies": {},
- "dependencies": {
- },
- "peerDependencies": {}
-}
diff --git a/js/packages/dapp-githubhint/parity.js b/js/packages/dapp-githubhint/parity.js
deleted file mode 100644
index 742386288..000000000
--- a/js/packages/dapp-githubhint/parity.js
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import Api from '@parity/api';
-
-const ethereumProvider = window.ethereum || window.parent.ethereum;
-
-if (!ethereumProvider) {
- throw new Error('Unable to locate EthereumProvider, object not attached');
-}
-
-const api = new Api(ethereumProvider);
-
-export {
- api
-};
diff --git a/js/packages/dapp-githubhint/services.js b/js/packages/dapp-githubhint/services.js
deleted file mode 100644
index 048fc6f14..000000000
--- a/js/packages/dapp-githubhint/services.js
+++ /dev/null
@@ -1,61 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import * as abis from '@parity/shared/contracts/abi';
-
-import { api } from './parity';
-
-let defaultSubscriptionId;
-
-export function attachInterface () {
- return api.parity
- .registryAddress()
- .then((registryAddress) => {
- console.log(`the registry was found at ${registryAddress}`);
-
- return api
- .newContract(abis.registry, registryAddress).instance
- .getAddress.call({}, [api.util.sha3('githubhint'), 'A']);
- })
- .then((address) => {
- console.log(`githubhint was found at ${address}`);
-
- const contract = api.newContract(abis.githubhint, address);
-
- return {
- address,
- contract,
- instance: contract.instance
- };
- })
- .catch((error) => {
- console.error('attachInterface', error);
- });
-}
-
-export function subscribeDefaultAddress (callback) {
- return api
- .subscribe('parity_defaultAccount', callback)
- .then((subscriptionId) => {
- defaultSubscriptionId = subscriptionId;
-
- return defaultSubscriptionId;
- });
-}
-
-export function unsubscribeDefaultAddress () {
- return api.unsubscribe(defaultSubscriptionId);
-}
diff --git a/js/packages/dapp-home/Accounts/accounts.css b/js/packages/dapp-home/Accounts/accounts.css
deleted file mode 100644
index a6b08f344..000000000
--- a/js/packages/dapp-home/Accounts/accounts.css
+++ /dev/null
@@ -1,50 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.accounts {
- margin-top: 1.5em;
- text-align: center;
-
- .account {
- position: relative;
- line-height: 2em;
- vertical-align: middle;
- white-space: nowrap;
-
- .icon {
- margin: 0;
- }
-
- .link, .name {
- display: block;
- overflow: hidden;
- text-overflow: ellipsis;
- }
-
- .name {
- white-space: nowrap;
- }
-
- .timestamp {
- color: #aaa;
- font-size: 0.75em;
- line-height: 1em;
- padding-top: 0;
- white-space: normal;
- }
- }
-}
diff --git a/js/packages/dapp-home/Accounts/accounts.js b/js/packages/dapp-home/Accounts/accounts.js
deleted file mode 100644
index 1b231fc0d..000000000
--- a/js/packages/dapp-home/Accounts/accounts.js
+++ /dev/null
@@ -1,145 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import moment from 'moment';
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-import { connect } from 'react-redux';
-import { Link } from 'react-router';
-
-import { arrayOrObjectProptype } from '@parity/shared/util/proptypes';
-import { Container, ContainerTitle, IdentityName, IdentityIcon, SectionList } from '@parity/ui';
-
-import styles from './accounts.css';
-
-class Accounts extends Component {
- static propTypes = {
- accountsInfo: PropTypes.object,
- history: arrayOrObjectProptype().isRequired
- };
-
- render () {
- return (
-
- );
- }
-
- return (
-
- );
- }
-
- renderHistoryItem = (history) => {
- const { accountsInfo } = this.props;
-
- if (!history || !history.entry) {
- return null;
- }
-
- const account = accountsInfo[history.entry];
-
- if (!account) {
- return null;
- }
-
- let linkType = 'addresses';
-
- if (account.uuid) {
- linkType = 'accounts';
- } else if (account.meta.wallet) {
- linkType = 'wallet';
- }
-
- return (
-
-
-
- }
- >
-
-
-
-
-
- );
- }
-}
-
-function mapStateToProps (state) {
- const { accountsInfo } = state.personal;
-
- return {
- accountsInfo
- };
-}
-
-export default connect(
- mapStateToProps,
- null
-)(Accounts);
diff --git a/js/packages/dapp-home/Accounts/accounts.spec.js b/js/packages/dapp-home/Accounts/accounts.spec.js
deleted file mode 100644
index 368ebcedb..000000000
--- a/js/packages/dapp-home/Accounts/accounts.spec.js
+++ /dev/null
@@ -1,71 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { shallow } from 'enzyme';
-import React from 'react';
-import sinon from 'sinon';
-
-import Accounts from './';
-
-let component;
-let store;
-
-function createRedux () {
- store = {
- dispatch: sinon.stub(),
- subscribe: sinon.stub(),
- getState: () => {
- return {
- personal: {
- accountsInfo: { '0x123': {} }
- }
- };
- }
- };
-
- return store;
-}
-
-function render (history = []) {
- component = shallow(
- ,
- {
- context: {
- store: createRedux()
- }
- }
- ).find('Accounts').shallow();
-
- return component;
-}
-
-describe('views/Home/Accounts', () => {
- it('renders defaults', () => {
- expect(render()).to.be.ok;
- });
-
- describe('no history', () => {
- beforeEach(() => {
- render();
- });
-
- it('renders empty message', () => {
- expect(component.find('FormattedMessage').props().id).to.equal('home.accounts.none');
- });
- });
-});
diff --git a/js/packages/dapp-home/Accounts/index.js b/js/packages/dapp-home/Accounts/index.js
deleted file mode 100644
index 027387e70..000000000
--- a/js/packages/dapp-home/Accounts/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './accounts';
diff --git a/js/packages/dapp-home/Dapps/dapp.js b/js/packages/dapp-home/Dapps/dapp.js
deleted file mode 100644
index df75bac73..000000000
--- a/js/packages/dapp-home/Dapps/dapp.js
+++ /dev/null
@@ -1,90 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import moment from 'moment';
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-import { Link } from 'react-router';
-
-import { Container, DappIcon } from '@parity/ui';
-
-import styles from './dapps.css';
-
-export default class Dapp extends Component {
- static propTypes = {
- id: PropTypes.string.isRequired,
- store: PropTypes.object.isRequired,
- timestamp: PropTypes.number.isRequired
- }
-
- state = {
- dapp: null
- }
-
- componentWillMount () {
- return this.loadApp();
- }
-
- render () {
- const { id, timestamp } = this.props;
- const { dapp } = this.state;
-
- if (!dapp) {
- return null;
- }
-
- return (
-
-
-
- }
- >
-
-
-
- { dapp.name }
-
-
-
- );
- }
-
- loadApp = () => {
- const { id, store } = this.props;
-
- return store
- .loadApp(id)
- .then((dapp) => {
- this.setState({ dapp });
- });
- }
-}
diff --git a/js/packages/dapp-home/Dapps/dapp.spec.js b/js/packages/dapp-home/Dapps/dapp.spec.js
deleted file mode 100644
index d7c5b09bd..000000000
--- a/js/packages/dapp-home/Dapps/dapp.spec.js
+++ /dev/null
@@ -1,55 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { shallow } from 'enzyme';
-import React from 'react';
-
-import Dapp from './dapp';
-
-import { createStore } from './dapps.test.js';
-
-let component;
-let instance;
-let store;
-
-function render () {
- store = createStore();
- component = shallow(
-
- );
- instance = component.instance();
-
- return component;
-}
-
-describe('views/Home/Dapp', () => {
- beforeEach(() => {
- render();
- return instance.componentWillMount();
- });
-
- it('renders defaults', () => {
- expect(component).to.be.ok;
- });
-
- it('loads the dapp on mount', () => {
- expect(store.loadApp).to.have.been.calledWith('testId');
- });
-});
diff --git a/js/packages/dapp-home/Dapps/dapps.css b/js/packages/dapp-home/Dapps/dapps.css
deleted file mode 100644
index b8e9c01df..000000000
--- a/js/packages/dapp-home/Dapps/dapps.css
+++ /dev/null
@@ -1,48 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.dapps {
- margin-top: 1.5em;
- text-align: center;
-
- .dapp {
- position: relative;
- line-height: 2em;
- vertical-align: middle;
-
- .icon {
- margin: 0;
- }
-
- .link, .name {
- display: block;
- overflow: hidden;
- text-overflow: ellipsis;
- }
-
- .name {
- white-space: nowrap;
- }
-
- .timestamp {
- color: #aaa;
- font-size: 0.75em;
- line-height: 1em;
- padding-top: 0;
- }
- }
-}
diff --git a/js/packages/dapp-home/Dapps/dapps.js b/js/packages/dapp-home/Dapps/dapps.js
deleted file mode 100644
index 5a4f9c10b..000000000
--- a/js/packages/dapp-home/Dapps/dapps.js
+++ /dev/null
@@ -1,87 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-
-import { arrayOrObjectProptype } from '@parity/shared/util/proptypes';
-import { ContainerTitle, SectionList } from '@parity/ui';
-
-import Dapp from './dapp';
-import styles from './dapps.css';
-
-export default class Dapps extends Component {
- static propTypes = {
- history: arrayOrObjectProptype().isRequired,
- store: PropTypes.object.isRequired
- }
-
- render () {
- return (
-
- );
- }
-
- return (
-
- );
- }
-
- renderHistoryItem = (history) => {
- if (!history || !history.entry) {
- return null;
- }
-
- const { store } = this.props;
-
- return (
-
- );
- }
-}
diff --git a/js/packages/dapp-home/Dapps/dapps.spec.js b/js/packages/dapp-home/Dapps/dapps.spec.js
deleted file mode 100644
index 8dcb938f4..000000000
--- a/js/packages/dapp-home/Dapps/dapps.spec.js
+++ /dev/null
@@ -1,68 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { shallow } from 'enzyme';
-import React from 'react';
-
-import Dapps from './';
-
-import { createStore } from './dapps.test.js';
-
-let component;
-let store;
-
-function render (history = []) {
- store = createStore();
- component = shallow(
-
- );
-
- return component;
-}
-
-describe('views/Home/Dapps', () => {
- it('renders defaults', () => {
- expect(render()).to.be.ok;
- });
-
- describe('no history', () => {
- beforeEach(() => {
- render();
- });
-
- it('renders empty message', () => {
- expect(component.find('FormattedMessage').props().id).to.equal('home.dapps.none');
- });
- });
-
- describe('with history', () => {
- const HISTORY = [
- { timestamp: 1, entry: 'testABC' },
- { timestamp: 2, entry: 'testDEF' }
- ];
-
- beforeEach(() => {
- render(HISTORY);
- });
-
- it('renders SectionList', () => {
- expect(component.find('SectionList').length).to.equal(1);
- });
- });
-});
diff --git a/js/packages/dapp-home/Dapps/dapps.test.js b/js/packages/dapp-home/Dapps/dapps.test.js
deleted file mode 100644
index 3593d7f3e..000000000
--- a/js/packages/dapp-home/Dapps/dapps.test.js
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import sinon from 'sinon';
-
-function createStore () {
- return {
- loadApp: sinon.stub().resolves({ name: 'testName' })
- };
-}
-
-export {
- createStore
-};
diff --git a/js/packages/dapp-home/Dapps/index.js b/js/packages/dapp-home/Dapps/index.js
deleted file mode 100644
index 9e6dddb63..000000000
--- a/js/packages/dapp-home/Dapps/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './dapps';
diff --git a/js/packages/dapp-home/News/index.js b/js/packages/dapp-home/News/index.js
deleted file mode 100644
index 437e53a6e..000000000
--- a/js/packages/dapp-home/News/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './news';
diff --git a/js/packages/dapp-home/News/news.css b/js/packages/dapp-home/News/news.css
deleted file mode 100644
index f6a19affa..000000000
--- a/js/packages/dapp-home/News/news.css
+++ /dev/null
@@ -1,73 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.news {
-}
-
-.markdown {
- line-height: 1.2em;
-}
-
-.item {
- height: 240px;
- opacity: 0.85;
- position: relative;
- width: 100%;
-
- .background {
- background-repeat: no-repeat;
- background-position: 50% 50%;
- background-size: cover;
- bottom: 0;
- left: 0;
- position: absolute;
- right: 0;
- top: 0;
- width: auto;
- }
-
- .overlay {
- background: white;
- color: #333;
- display: none;
- left: 0;
- position: absolute;
- right: 0;
- top: 100%;
- padding: 0 1.5em 1em 1.5em;
- }
-
- .title {
- background: rgba(255, 255, 255, 0.85);
- bottom: 0;
- color: #333;
- font-size: 1.17em;
- left: 0;
- padding: 1rem 1.5rem;
- position: absolute;
- right: 0;
- text-transform: uppercase;
- }
-
- &:hover {
- opacity: 1;
-
- .overlay {
- display: block;
- }
- }
-}
diff --git a/js/packages/dapp-home/News/news.js b/js/packages/dapp-home/News/news.js
deleted file mode 100644
index 97305bc94..000000000
--- a/js/packages/dapp-home/News/news.js
+++ /dev/null
@@ -1,97 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { observer } from 'mobx-react';
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import ReactMarkdown from 'react-markdown';
-
-import { SectionList } from '@parity/ui';
-
-import { createRenderers } from './renderers';
-import Store from './store';
-import styles from './news.css';
-
-const VERSION_ID = '1';
-
-@observer
-export default class News extends Component {
- static contextTypes = {
- api: PropTypes.object.isRequired
- };
-
- store = Store.get(this.context.api);
-
- componentWillMount () {
- return this.store.retrieveNews(VERSION_ID);
- }
-
- render () {
- const { newsItems } = this.store;
-
- if (!newsItems || !newsItems.length) {
- return null;
- }
-
- return (
-
- );
- }
-
- renderItem = (item) => {
- if (!item) {
- return null;
- }
-
- const inlineStyles = item.style || {};
-
- return (
-
-
-
- { item.title }
-
-
-
-
-
- );
- }
-}
-
-export {
- VERSION_ID
-};
diff --git a/js/packages/dapp-home/News/news.spec.js b/js/packages/dapp-home/News/news.spec.js
deleted file mode 100644
index 6da5c2919..000000000
--- a/js/packages/dapp-home/News/news.spec.js
+++ /dev/null
@@ -1,54 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { shallow } from 'enzyme';
-import React from 'react';
-
-import News from './news';
-import { restoreGlobals, stubGlobals } from './news.test.js';
-
-let component;
-let instance;
-
-function render () {
- component = shallow(
-
- );
- instance = component.instance();
-
- return component;
-}
-
-describe('views/Home/News', () => {
- beforeEach(() => {
- stubGlobals();
- render();
-
- return instance.componentWillMount();
- });
-
- afterEach(() => {
- restoreGlobals();
- });
-
- it('renders defaults', () => {
- expect(component).to.be.ok;
- });
-
- it('retrieves the content meta on mount', () => {
- expect(instance.store.newsItems).to.equal('testContent');
- });
-});
diff --git a/js/packages/dapp-home/News/news.test.js b/js/packages/dapp-home/News/news.test.js
deleted file mode 100644
index c5d3dbcac..000000000
--- a/js/packages/dapp-home/News/news.test.js
+++ /dev/null
@@ -1,54 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import sinon from 'sinon';
-
-import Contracts from '@parity/shared/contracts';
-
-import { VERSION_ID } from './news';
-
-let contracts;
-let globalContractsGet;
-let globalFetch;
-
-export function stubGlobals () {
- contracts = {
- githubHint: {
- getEntry: sinon.stub().resolves(['testUrl', 'testOwner', 'testCommit'])
- },
- registry: {
- lookupMeta: sinon.stub().resolves('testMeta')
- }
- };
-
- globalContractsGet = Contracts.get;
- globalFetch = global.fetch;
-
- sinon.stub(Contracts, 'get', () => contracts);
- sinon.stub(global, 'fetch').resolves({
- ok: true,
- json: sinon.stub().resolves({
- [VERSION_ID]: {
- items: 'testContent'
- }
- })
- });
-}
-
-export function restoreGlobals () {
- Contracts.get = globalContractsGet;
- global.fetch = globalFetch;
-}
diff --git a/js/packages/dapp-home/News/renderers.js b/js/packages/dapp-home/News/renderers.js
deleted file mode 100644
index fde476029..000000000
--- a/js/packages/dapp-home/News/renderers.js
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { createElement } from 'react';
-
-export function createRenderers (tagStyles = {}) {
- return Object
- .keys(tagStyles)
- .reduce((renderers, tag) => {
- switch (tag) {
- case 'a':
- case 'link':
- renderers['link'] = (mdProps) => {
- const { children, href, title } = mdProps;
- const style = tagStyles[tag];
-
- return createElement('a', { href, title, style }, children);
- };
- break;
- }
-
- return renderers;
- }, {});
-}
diff --git a/js/packages/dapp-home/News/store.js b/js/packages/dapp-home/News/store.js
deleted file mode 100644
index b6f04787c..000000000
--- a/js/packages/dapp-home/News/store.js
+++ /dev/null
@@ -1,72 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { action, observable } from 'mobx';
-
-import Contracts from '@parity/shared/contracts';
-
-let instance = null;
-
-export default class Store {
- @observable newsItems = null;
-
- constructor (api) {
- this._api = api;
- }
-
- @action setNewsItems = (newsItems) => {
- this.newsItems = newsItems;
- }
-
- retrieveNews (versionId) {
- const contracts = Contracts.get(this._api);
-
- return contracts.registry
- .lookupMeta('paritynews', 'CONTENT')
- .then((contentId) => {
- return contracts.githubHint.getEntry(contentId);
- })
- .then(([url, owner, commit]) => {
- if (!url) {
- return null;
- }
-
- return fetch(url).then((response) => {
- if (!response.ok) {
- return null;
- }
-
- return response.json();
- });
- })
- .then((news) => {
- if (news && news[versionId]) {
- this.setNewsItems(news[versionId].items);
- }
- })
- .catch((error) => {
- console.warn('retrieveNews', error);
- });
- }
-
- static get (api) {
- if (!instance) {
- instance = new Store(api);
- }
-
- return instance;
- }
-}
diff --git a/js/packages/dapp-home/News/store.spec.js b/js/packages/dapp-home/News/store.spec.js
deleted file mode 100644
index 6e77e0ee8..000000000
--- a/js/packages/dapp-home/News/store.spec.js
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { VERSION_ID } from './news';
-import { restoreGlobals, stubGlobals } from './news.test.js';
-import Store from './store';
-
-let store;
-
-function create () {
- store = new Store();
-
- return store;
-}
-
-describe('views/Home/News/Store', () => {
- beforeEach(() => {
- stubGlobals();
- create();
- });
-
- afterEach(() => {
- restoreGlobals();
- });
-
- describe('@action', () => {
- describe('setNewsItems', () => {
- it('sets the items', () => {
- store.setNewsItems('testing');
- expect(store.newsItems).to.equal('testing');
- });
- });
- });
-
- describe('operations', () => {
- describe('retrieveNews', () => {
- it('retrieves the items', () => {
- return store.retrieveNews(VERSION_ID).then(() => {
- expect(store.newsItems).to.equal('testContent');
- });
- });
- });
- });
-});
diff --git a/js/packages/dapp-home/Urls/index.js b/js/packages/dapp-home/Urls/index.js
deleted file mode 100644
index d28700edb..000000000
--- a/js/packages/dapp-home/Urls/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './urls';
diff --git a/js/packages/dapp-home/Urls/urls.css b/js/packages/dapp-home/Urls/urls.css
deleted file mode 100644
index 5b5deeb5b..000000000
--- a/js/packages/dapp-home/Urls/urls.css
+++ /dev/null
@@ -1,80 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.urls {
- text-align: center;
-
- .layout {
- box-sizing: border-box;
- margin: 1.5em auto;
- padding: 0 1em;
- width: 50%;
-
- .empty {
- margin-top: 0.5em;
- opacity: 0.75;
- }
-
- .historyItem {
- height: auto;
- margin-top: 1em;
- position: relative;
- width: 100%;
-
- .linkIcon {
- opacity: 0;
- position: absolute;
- right: 0.5em;
- top: 0.5em;
- }
-
- .url {
- display: block;
- color: rgb(0, 151, 167);
- overflow: hidden;
- text-overflow: ellipsis;
- }
-
- .timestamp {
- color: #aaa;
- font-size: 0.75em;
- line-height: 1em;
- padding-top: 0.5rem;
- }
-
- &:hover {
- opacity: 1;
-
- .linkIcon {
- opacity: 1;
- }
- }
- }
-
- .input {
- background: rgba(255, 255, 255, 0.25);
- border: 1px solid rgba(255, 255, 255, 0.5);
- border-radius: 0.25em;
- box-sizing: border-box;
- color: white;
- display: block;
- font-size: 1.25em;
- padding: 0.5em;
- width: 100%;
- }
- }
-}
diff --git a/js/packages/dapp-home/Urls/urls.js b/js/packages/dapp-home/Urls/urls.js
deleted file mode 100644
index 1b76f68e8..000000000
--- a/js/packages/dapp-home/Urls/urls.js
+++ /dev/null
@@ -1,140 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { observer } from 'mobx-react';
-import moment from 'moment';
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-
-import { Container, ContainerTitle, DappUrlInput, SectionList } from '@parity/ui';
-import { LinkIcon } from '@parity/ui/Icons';
-
-import styles from './urls.css';
-
-@observer
-export default class Urls extends Component {
- static contextTypes = {
- router: PropTypes.object.isRequired
- };
-
- static propTypes = {
- extensionStore: PropTypes.object.isRequired,
- store: PropTypes.object.isRequired
- }
-
- render () {
- const { nextUrl } = this.props.store;
-
- return (
-
-
- );
- }
-
- onChangeUrl = (url) => {
- this.props.store.setNextUrl(url);
- }
-
- onGotoUrl = (url) => {
- const { router } = this.context;
- const { extensionStore } = this.props;
-
- this.props.store.gotoUrl(url);
-
- if (extensionStore.hasExtension) {
- window.open(this.props.store.currentUrl, '_blank');
- } else {
- router.push('/web');
- }
- }
-
- onRestoreUrl = () => {
- this.props.store.restoreUrl();
- }
-}
diff --git a/js/packages/dapp-home/Urls/urls.spec.js b/js/packages/dapp-home/Urls/urls.spec.js
deleted file mode 100644
index 6c1438fe0..000000000
--- a/js/packages/dapp-home/Urls/urls.spec.js
+++ /dev/null
@@ -1,124 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { shallow } from 'enzyme';
-import React from 'react';
-import sinon from 'sinon';
-
-import Urls from './';
-
-const NEXT_URL = 'http://somewhere.next';
-
-let component;
-let instance;
-let router;
-let store;
-
-function createRouter () {
- router = {
- push: sinon.stub()
- };
-
- return router;
-}
-
-function createStore () {
- store = {
- history: [],
- gotoUrl: sinon.stub(),
- restoreUrl: sinon.stub(),
- setNextUrl: sinon.stub(),
- nextUrl: NEXT_URL
- };
-
- return store;
-}
-
-function render () {
- component = shallow(
- ,
- {
- context: {
- router: createRouter()
- }
- }
- );
- instance = component.instance();
-
- return component;
-}
-
-describe('views/Home/Urls', () => {
- beforeEach(() => {
- render();
- });
-
- it('renders defaults', () => {
- expect(component).to.be.ok;
- });
-
- describe('input', () => {
- let input;
-
- beforeEach(() => {
- input = component.find('DappUrlInput');
- });
-
- it('renders the input cmponent', () => {
- expect(input.length).to.equal(1);
- });
-
- it('passes nextUrl as url', () => {
- expect(input.props().url).to.equal(NEXT_URL);
- });
- });
-
- describe('events', () => {
- describe('onChangeUrl', () => {
- it('performs setNextUrl on store', () => {
- instance.onChangeUrl('123');
- expect(store.setNextUrl).to.have.been.calledWith('123');
- });
- });
-
- describe('onGotoUrl', () => {
- it('performs gotoUrl on store', () => {
- instance.onGotoUrl();
- expect(store.gotoUrl).to.have.been.called;
- });
-
- it('passed the URL when provided', () => {
- instance.onGotoUrl('http://example.com');
- expect(store.gotoUrl).to.have.been.calledWith('http://example.com');
- });
-
- it('does route navigation when executed', () => {
- instance.onGotoUrl();
- expect(router.push).to.have.been.calledWith('/web');
- });
- });
-
- describe('onRestoreUrl', () => {
- it('performs restoreUrl on store', () => {
- instance.onRestoreUrl();
- expect(store.restoreUrl).to.have.been.called;
- });
- });
- });
-});
diff --git a/js/packages/dapp-home/api.js b/js/packages/dapp-home/api.js
deleted file mode 100644
index b2e52cca0..000000000
--- a/js/packages/dapp-home/api.js
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import Api from '@parity/api';
-
-const ethereumProvider = window.ethereum || window.parent.ethereum;
-
-if (!ethereumProvider) {
- throw new Error('Unable to locate EthereumProvider, object not attached');
-}
-
-export default new Api(ethereumProvider);
diff --git a/js/packages/dapp-home/home.css b/js/packages/dapp-home/home.css
deleted file mode 100644
index c607e4993..000000000
--- a/js/packages/dapp-home/home.css
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.accounts {
- margin-top: 1.5em;
-}
-
-.body {
- padding-bottom: 3em;
-}
-
-.empty {
- margin-top: 1.5em;
- opacity: 0.5;
-}
-
-.row {
- display: flex;
-
- .column {
- box-sizing: border-box;
- flex: 0 1 50%;
- padding: 0 1.5em;
- width: 50%;
- }
-}
diff --git a/js/packages/dapp-home/home.js b/js/packages/dapp-home/home.js
deleted file mode 100644
index 5617f3e2d..000000000
--- a/js/packages/dapp-home/home.js
+++ /dev/null
@@ -1,106 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { observer } from 'mobx-react';
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { connect } from 'react-redux';
-import { FormattedMessage } from 'react-intl';
-
-import HistoryStore from '@parity/shared/mobx/historyStore';
-import { Page } from '@parity/ui';
-
-import WebStore from '@parity/dapp-web/store';
-
-// FIXME: Don't really want to import from ~/src
-import DappsStore from '~/src/Dapps/dappsStore';
-import ExtensionStore from '~/src/Extension/store';
-
-import Accounts from './Accounts';
-import Dapps from './Dapps';
-import News from './News';
-import Urls from './Urls';
-import styles from './home.css';
-
-@observer
-class Home extends Component {
- static contextTypes = {
- api: PropTypes.object.isRequired
- };
-
- static propTypes = {
- availability: PropTypes.string.isRequired
- };
-
- dappsStore = DappsStore.get(this.context.api);
- extensionStore = ExtensionStore.get();
- webStore = WebStore.get(this.context.api);
-
- accountsHistory = HistoryStore.get('accounts');
- dappsHistory = HistoryStore.get('dapps');
-
- componentWillMount () {
- return this.webStore.loadHistory();
- }
-
- render () {
- const urls = this.props.availability !== 'personal' ? null : (
-
- );
-
- return (
-
- }
- >
-
- { urls }
-
-
-
-
-
-
-
-
-
- );
- }
-}
-
-function mapStateToProps (initState) {
- return (state) => {
- const { availability = 'unknown' } = state.nodeStatus.nodeKind || {};
-
- return { availability };
- };
-}
-
-export default connect(
- mapStateToProps,
- null
-)(Home);
diff --git a/js/packages/dapp-home/home.spec.js b/js/packages/dapp-home/home.spec.js
deleted file mode 100644
index d7a3ae2ab..000000000
--- a/js/packages/dapp-home/home.spec.js
+++ /dev/null
@@ -1,119 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { shallow } from 'enzyme';
-import React from 'react';
-import sinon from 'sinon';
-
-import Home from './home';
-
-const TEST_APP_HISTORY = [];
-
-let api;
-let component;
-let instance;
-let store;
-
-function createStore () {
- store = {
- dispatch: sinon.stub(),
- subscribe: sinon.stub(),
- getState: () => {
- return {
- nodeStatus: {
- nodeKind: {
- 'availability': 'personal'
- }
- }
- };
- }
- };
-
- return store;
-}
-
-function createApi () {
- api = {
- parity: {
- listRecentDapps: sinon.stub().resolves(TEST_APP_HISTORY)
- }
- };
-
- return api;
-}
-
-function render () {
- component = shallow(
- ,
- {
- context: {
- store: createStore()
- }
- }
- ).find('Home').shallow({
- context: {
- api: createApi()
- }
- });
- instance = component.instance();
-
- return component;
-}
-
-describe('views/Home', () => {
- beforeEach(() => {
- render();
- });
-
- it('renders defaults', () => {
- expect(component).to.be.ok;
- });
-
- describe('lifecycle', () => {
- describe('componentWillMount', () => {
- beforeEach(() => {
- sinon.stub(instance.webStore, 'loadHistory');
- return instance.componentWillMount();
- });
-
- afterEach(() => {
- instance.webStore.loadHistory.restore();
- });
-
- it('calls into webStore loadHistory', () => {
- expect(instance.webStore.loadHistory).to.have.been.called;
- });
- });
- });
-
- describe('components', () => {
- it('renders Accounts', () => {
- expect(component.find('Connect(Accounts)').length).to.equal(1);
- });
-
- it('renders Dapps', () => {
- expect(component.find('Dapps').length).to.equal(1);
- });
-
- it('renders News', () => {
- expect(component.find('News').length).to.equal(1);
- });
-
- it('renders Urls', () => {
- expect(component.find('Urls').length).to.equal(1);
- });
- });
-});
diff --git a/js/packages/dapp-home/index.js b/js/packages/dapp-home/index.js
deleted file mode 100644
index d431eb41f..000000000
--- a/js/packages/dapp-home/index.js
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import ReactDOM from 'react-dom';
-import React from 'react';
-import { Route, Router, hashHistory } from 'react-router';
-
-import injectTapEventPlugin from 'react-tap-event-plugin';
-injectTapEventPlugin();
-
-import { initStore } from '@parity/shared/redux';
-import ContextProvider from '@parity/ui/ContextProvider';
-
-import api from './api';
-import Home from './home';
-
-const store = initStore(api, hashHistory);
-
-ReactDOM.render(
-
-
-
-
- ,
- document.querySelector('#container')
-);
diff --git a/js/packages/dapp-home/package.json b/js/packages/dapp-home/package.json
deleted file mode 100644
index 64bd80bd9..000000000
--- a/js/packages/dapp-home/package.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "name": "@parity/dapp-home",
- "description": "Parity default Home view",
- "version": "1.99.99",
- "main": "index.js",
- "author": "Parity Team ",
- "maintainers": [],
- "contributors": [],
- "license": "GPL-3.0",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/paritytech/dapp-home.git"
- },
- "keywords": [],
- "scripts": {},
- "devDependencies": {},
- "dependencies": {},
- "peerDependencies": {}
-}
diff --git a/js/packages/dapp-localtx/Application/application.css b/js/packages/dapp-localtx/Application/application.css
deleted file mode 100644
index 15762c5d4..000000000
--- a/js/packages/dapp-localtx/Application/application.css
+++ /dev/null
@@ -1,43 +0,0 @@
-.container {
- padding: 1rem 2rem;
- text-align: center;
-
- h1 {
- margin-top: 3rem;
- margin-bottom: 1rem;
- }
-
- table {
- text-align: left;
- margin: auto;
- max-width: 90vw;
-
- th {
- text-align: center;
- }
-
- td {
- text-align: center;
- }
- }
-
- button {
- background-color: rgba(0, 136, 170, 1);
- border: none;
- border-radius: 5px;
- color: white;
- font-size: 1rem;
- padding: 0.5em 1em;
- width: 100%;
-
- &:hover {
- background-color: rgba(0, 136, 170, 0.8);
- cursor: pointer;
- }
- }
-
- input {
- font-size: 1rem;
- padding: 0.5em 1em;
- }
-}
diff --git a/js/packages/dapp-localtx/Application/application.js b/js/packages/dapp-localtx/Application/application.js
deleted file mode 100644
index 8efadcf1a..000000000
--- a/js/packages/dapp-localtx/Application/application.js
+++ /dev/null
@@ -1,212 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import BigNumber from 'bignumber.js';
-import React, { Component } from 'react';
-
-import { api } from '../parity';
-
-import styles from './application.css';
-
-import { Transaction, LocalTransaction } from '../Transaction';
-
-export default class Application extends Component {
- state = {
- loading: true,
- transactions: [],
- localTransactions: {},
- blockNumber: 0
- }
-
- componentDidMount () {
- const poll = () => {
- this._timeout = window.setTimeout(() => {
- this.fetchTransactionData().then(poll).catch(poll);
- }, 1000);
- };
-
- poll();
- }
-
- componentWillUnmount () {
- clearTimeout(this._timeout);
- }
-
- fetchTransactionData () {
- return Promise.all([
- api.parity.pendingTransactions(),
- api.parity.pendingTransactionsStats(),
- api.parity.localTransactions(),
- api.eth.blockNumber()
- ]).then(([pending, stats, local, blockNumber]) => {
- // Combine results together
- const transactions = pending.map(tx => {
- return {
- transaction: tx,
- stats: stats[tx.hash],
- isLocal: !!local[tx.hash]
- };
- });
-
- // Add transaction data to locals
- transactions
- .filter(tx => tx.isLocal)
- .map(data => {
- const tx = data.transaction;
-
- local[tx.hash].transaction = tx;
- local[tx.hash].stats = data.stats;
- });
- // Convert local transactions to array
- const localTransactions = Object.keys(local).map(hash => {
- const data = local[hash];
-
- data.txHash = hash;
- return data;
- });
-
- // Sort local transactions by nonce (move future to the end)
- localTransactions.sort((a, b) => {
- a = a.transaction || {};
- b = b.transaction || {};
-
- if (a.from && b.from && a.from !== b.from) {
- return a.from < b.from;
- }
-
- if (!a.nonce || !b.nonce) {
- return !a.nonce ? 1 : -1;
- }
-
- return new BigNumber(a.nonce).comparedTo(new BigNumber(b.nonce));
- });
-
- this.setState({
- loading: false,
- transactions,
- localTransactions,
- blockNumber
- });
- });
- }
-
- render () {
- const { loading } = this.state;
-
- if (loading) {
- return (
-
- );
- }
-}
diff --git a/js/packages/dapp-localtx/Application/application.spec.js b/js/packages/dapp-localtx/Application/application.spec.js
deleted file mode 100644
index a5e324b97..000000000
--- a/js/packages/dapp-localtx/Application/application.spec.js
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React from 'react';
-import { shallow } from 'enzyme';
-
-import '@parity/shared/environment/tests';
-
-import Application from './application';
-
-describe('dapps/localtx/Application', () => {
- describe('rendering', () => {
- it('renders without crashing', () => {
- const rendered = shallow();
-
- expect(rendered).to.be.defined;
- });
- });
-});
diff --git a/js/packages/dapp-localtx/Application/index.js b/js/packages/dapp-localtx/Application/index.js
deleted file mode 100644
index 3d8d1ca3b..000000000
--- a/js/packages/dapp-localtx/Application/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './application';
diff --git a/js/packages/dapp-localtx/IdentityIcon/identityIcon.css b/js/packages/dapp-localtx/IdentityIcon/identityIcon.css
deleted file mode 100644
index 01aba746d..000000000
--- a/js/packages/dapp-localtx/IdentityIcon/identityIcon.css
+++ /dev/null
@@ -1,23 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.icon {
- width: 24px;
- height: 24px;
- border-radius: 50%;
- margin-right: 0.5em;
-}
diff --git a/js/packages/dapp-localtx/IdentityIcon/identityIcon.js b/js/packages/dapp-localtx/IdentityIcon/identityIcon.js
deleted file mode 100644
index 31c3e244e..000000000
--- a/js/packages/dapp-localtx/IdentityIcon/identityIcon.js
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-
-import { api } from '../parity';
-import styles from './identityIcon.css';
-
-export default class IdentityIcon extends Component {
- static propTypes = {
- address: PropTypes.string.isRequired
- }
-
- render () {
- const { address } = this.props;
-
- return (
-
- );
- }
-}
diff --git a/js/packages/dapp-localtx/IdentityIcon/index.js b/js/packages/dapp-localtx/IdentityIcon/index.js
deleted file mode 100644
index 091913564..000000000
--- a/js/packages/dapp-localtx/IdentityIcon/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './identityIcon';
diff --git a/js/packages/dapp-localtx/Transaction/index.js b/js/packages/dapp-localtx/Transaction/index.js
deleted file mode 100644
index fd940c68d..000000000
--- a/js/packages/dapp-localtx/Transaction/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export { Transaction, LocalTransaction } from './transaction';
diff --git a/js/packages/dapp-localtx/Transaction/transaction.css b/js/packages/dapp-localtx/Transaction/transaction.css
deleted file mode 100644
index b06942ed7..000000000
--- a/js/packages/dapp-localtx/Transaction/transaction.css
+++ /dev/null
@@ -1,39 +0,0 @@
-.from {
- white-space: nowrap;
-
- img {
- vertical-align: middle;
- }
-}
-
-.txhash {
- display: inline-block;
- overflow: hidden;
- padding-right: 3ch;
- text-overflow: ellipsis;
- width: 10ch;
-}
-
-.transaction {
- td {
- padding: 7px 15px;
- }
-
- td:first-child {
- padding: 7px 0;
- }
-
- &.local {
- background: #8bc34a;
- }
-}
-
-.nowrap {
- white-space: nowrap;
-}
-
-.edit {
- label, input {
- display: block;
- }
-}
diff --git a/js/packages/dapp-localtx/Transaction/transaction.js b/js/packages/dapp-localtx/Transaction/transaction.js
deleted file mode 100644
index c1c6c6257..000000000
--- a/js/packages/dapp-localtx/Transaction/transaction.js
+++ /dev/null
@@ -1,396 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import BigNumber from 'bignumber.js';
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import classnames from 'classnames';
-
-import { api } from '../parity';
-
-import styles from './transaction.css';
-
-import IdentityIcon from '../IdentityIcon';
-
-class BaseTransaction extends Component {
- shortHash (hash) {
- return `${hash.substr(0, 5)}..${hash.substr(hash.length - 3)}`;
- }
-
- renderHash (hash) {
- return (
-
- { hash }
-
- );
- }
-
- renderFrom (transaction) {
- if (!transaction) {
- return '-';
- }
-
- return (
-
- );
- }
-
- renderStatus () {
- const { details } = this.props;
-
- let state = {
- 'pending': () => 'In queue: Pending',
- 'future': () => 'In queue: Future',
- 'mined': () => 'Mined',
- 'dropped': () => 'Dropped because of queue limit',
- 'invalid': () => 'Transaction is invalid',
- 'rejected': () => `Rejected: ${details.error}`,
- 'replaced': () => `Replaced by ${this.shortHash(details.hash)}`
- }[this.props.status];
-
- return state ? state() : 'unknown';
- }
-
- // TODO [ToDr] Gas Price / Gas selection is not needed
- // when signer supports gasPrice/gas tunning.
- renderResubmit () {
- const { transaction } = this.props;
- const { gasPrice, gas } = this.state;
-
- return (
-
-
-
-
-
- { this.renderHash(transaction.hash) }
-
-
- { this.renderFrom(transaction) }
-
-
-
- shannon
-
-
-
- MGas
-
-
-
-
-
- );
- }
-}
diff --git a/js/packages/dapp-localtx/Transaction/transaction.spec.js b/js/packages/dapp-localtx/Transaction/transaction.spec.js
deleted file mode 100644
index cc631e413..000000000
--- a/js/packages/dapp-localtx/Transaction/transaction.spec.js
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React from 'react';
-import { shallow } from 'enzyme';
-
-import EthApi from '@parity/api';
-import '@parity/shared/environment/tests';
-
-// Mock API for tests
-import * as Api from '../parity';
-Api.api = {
- util: EthApi.prototype.util
-};
-
-import BigNumber from 'bignumber.js';
-import { Transaction, LocalTransaction } from './transaction';
-
-describe('dapps/localtx/Transaction', () => {
- describe('rendering', () => {
- it('renders without crashing', () => {
- const transaction = {
- hash: '0x1234567890',
- nonce: new BigNumber(15),
- gasPrice: new BigNumber(10),
- gas: new BigNumber(10)
- };
- const rendered = shallow(
-
- );
-
- expect(rendered).to.be.defined;
- });
- });
-});
-
-describe('dapps/localtx/LocalTransaction', () => {
- describe('rendering', () => {
- it('renders without crashing', () => {
- const rendered = shallow(
-
- );
-
- expect(rendered).to.be.defined;
- });
- });
-});
diff --git a/js/packages/dapp-localtx/index.js b/js/packages/dapp-localtx/index.js
deleted file mode 100644
index de98cb636..000000000
--- a/js/packages/dapp-localtx/index.js
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import ReactDOM from 'react-dom';
-import React from 'react';
-import { AppContainer } from 'react-hot-loader';
-
-import injectTapEventPlugin from 'react-tap-event-plugin';
-injectTapEventPlugin();
-
-import Application from './Application';
-
-import '@parity/shared/assets/fonts/Roboto/font.css';
-import '@parity/shared/assets/fonts/RobotoMono/font.css';
-import '@parity/dapps/style.css';
-
-ReactDOM.render(
-
-
- ,
- document.querySelector('#container')
-);
-
-if (module.hot) {
- module.hot.accept('./Application/index.js', () => {
- require('./Application/index.js');
-
- ReactDOM.render(
-
-
- ,
- document.querySelector('#container')
- );
- });
-}
diff --git a/js/packages/dapp-localtx/package.json b/js/packages/dapp-localtx/package.json
deleted file mode 100644
index 92270c39b..000000000
--- a/js/packages/dapp-localtx/package.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "name": "@parity/dapp-localtx",
- "description": "Parity local transaction queue",
- "version": "1.99.99",
- "main": "index.js",
- "author": "Parity Team ",
- "maintainers": [],
- "contributors": [],
- "license": "GPL-3.0",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/paritytech/dapp-localtx.git"
- },
- "keywords": [],
- "scripts": {},
- "devDependencies": {},
- "dependencies": {
- },
- "peerDependencies": {}
-}
diff --git a/js/packages/dapp-localtx/parity.js b/js/packages/dapp-localtx/parity.js
deleted file mode 100644
index 742386288..000000000
--- a/js/packages/dapp-localtx/parity.js
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import Api from '@parity/api';
-
-const ethereumProvider = window.ethereum || window.parent.ethereum;
-
-if (!ethereumProvider) {
- throw new Error('Unable to locate EthereumProvider, object not attached');
-}
-
-const api = new Api(ethereumProvider);
-
-export {
- api
-};
diff --git a/js/packages/dapp-playground/api.js b/js/packages/dapp-playground/api.js
deleted file mode 100644
index b2e52cca0..000000000
--- a/js/packages/dapp-playground/api.js
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import Api from '@parity/api';
-
-const ethereumProvider = window.ethereum || window.parent.ethereum;
-
-if (!ethereumProvider) {
- throw new Error('Unable to locate EthereumProvider, object not attached');
-}
-
-export default new Api(ethereumProvider);
diff --git a/js/packages/dapp-playground/index.js b/js/packages/dapp-playground/index.js
deleted file mode 100644
index ed0a868d7..000000000
--- a/js/packages/dapp-playground/index.js
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import ReactDOM from 'react-dom';
-import React from 'react';
-import { Route, Router, hashHistory } from 'react-router';
-
-import injectTapEventPlugin from 'react-tap-event-plugin';
-injectTapEventPlugin();
-
-import { initStore } from '@parity/shared/redux';
-import ContextProvider from '@parity/ui/ContextProvider';
-
-import api from './api';
-import Playground from './playground';
-
-const store = initStore(api, hashHistory);
-
-ReactDOM.render(
-
-
-
-
- ,
- document.querySelector('#container')
-);
diff --git a/js/packages/dapp-playground/package.json b/js/packages/dapp-playground/package.json
deleted file mode 100644
index a8bf1a4a9..000000000
--- a/js/packages/dapp-playground/package.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "name": "@parity/dapp-playground",
- "description": "Parity component playground",
- "version": "1.99.99",
- "main": "index.js",
- "author": "Parity Team ",
- "maintainers": [],
- "contributors": [],
- "license": "GPL-3.0",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/paritytech/dapp-playground.git"
- },
- "keywords": [],
- "scripts": {},
- "devDependencies": {},
- "dependencies": {},
- "peerDependencies": {}
-}
diff --git a/js/packages/dapp-playground/playground.css b/js/packages/dapp-playground/playground.css
deleted file mode 100644
index 92556ae94..000000000
--- a/js/packages/dapp-playground/playground.css
+++ /dev/null
@@ -1,91 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-$codeBackground: #002b36;
-$codeColor: #93a1a1;
-
-.container {
- background-color: rgba(0, 0, 0, 0.5);
- position: fixed;
- top: 0;
- right: 0;
- bottom: 0;
- left: 0;
- padding: 1em;
- display: flex;
- flex-direction: column;
-
- .examples {
- flex: 1;
- overflow: auto;
- }
-}
-
-.title {
- font-size: 2.25em;
- margin-bottom: 1em;
-
- .select {
- font-size: 0.85em;
- font-family: monospace;
- display: inline-block;
- height: 1.5em;
- border: 1px solid #aaa;
- padding: 0 0.5em;
- color: #555;
- appearance: none;
- }
-}
-
-.exampleContainer {
- background-color: rgba(0, 0, 0, 0.5);
- padding: 1em;
- margin-bottom: 1em;
-
- &:last-child {
- margin-bottom: 0;
- }
-
- p {
- font-size: 1.25em;
- margin-top: 0;
- }
-}
-
-.example {
- display: flex;
- flex-direction: row;
-
- .code {
- flex: 1;
- overflow: auto;
- padding: 0.5em;
- background-color: $codeBackground;
- color: $codeColor;
- font-size: 0.75em;
-
- code {
- white-space: pre;
- }
- }
-
- .component {
- flex: 3;
- padding-left: 0.5em;
- overflow: auto;
- }
-}
diff --git a/js/packages/dapp-playground/playground.js b/js/packages/dapp-playground/playground.js
deleted file mode 100644
index 678e535e4..000000000
--- a/js/packages/dapp-playground/playground.js
+++ /dev/null
@@ -1,79 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { observer } from 'mobx-react';
-import React, { Component } from 'react';
-
-import AccountCard from '@parity/ui/AccountCard/accountCard.example';
-import CurrencySymbol from '@parity/ui/CurrencySymbol/currencySymbol.example';
-import Portal from '@parity/ui/Portal/portal.example';
-import QrCode from '@parity/ui/QrCode/qrCode.example';
-import SectionList from '@parity/ui/SectionList/sectionList.example';
-
-import PlaygroundStore from './store';
-import styles from './playground.css';
-
-PlaygroundStore.register();
-PlaygroundStore.register();
-PlaygroundStore.register();
-PlaygroundStore.register();
-PlaygroundStore.register();
-
-@observer
-export default class Playground extends Component {
- store = PlaygroundStore.get();
-
- render () {
- const { component, components } = this.store;
-
- return (
-
-
- Playground -
-
-
-
-
- { component }
-
-
- );
- }
-
- handleChange = (event) => {
- const { value } = event.target;
-
- this.store.setSelectedIndex(value);
- }
-}
diff --git a/js/packages/dapp-playground/playground.spec.js b/js/packages/dapp-playground/playground.spec.js
deleted file mode 100644
index 6ea23af65..000000000
--- a/js/packages/dapp-playground/playground.spec.js
+++ /dev/null
@@ -1,47 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { shallow } from 'enzyme';
-import React from 'react';
-
-import Playground from './playground';
-
-let component;
-let options;
-
-function render (props = {}) {
- component = shallow(
-
- );
-
- options = component.find('option');
-
- return component;
-}
-
-describe('playground', () => {
- beforeEach(() => {
- render();
- });
-
- it('renders defaults', () => {
- expect(component).to.be.ok;
- });
-
- it('renders multiple options', () => {
- expect(options.length).to.be.greaterThan(2);
- });
-});
diff --git a/js/packages/dapp-playground/playgroundExample.js b/js/packages/dapp-playground/playgroundExample.js
deleted file mode 100644
index 425e6d89e..000000000
--- a/js/packages/dapp-playground/playgroundExample.js
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React from 'react';
-import PropTypes from 'prop-types';
-import reactElementToJSXString from 'react-element-to-jsx-string';
-
-import styles from './playground.css';
-
-export default function PlaygroundExample ({ children, name }) {
- return (
-
- {
- name
- ?
{ name }
- : null
- }
-
-
- { reactElementToJSXString(children) }
-
-
- { children }
-
-
-
- );
-}
-
-PlaygroundExample.propTypes = {
- children: PropTypes.node,
- name: PropTypes.string
-};
diff --git a/js/packages/dapp-playground/store.js b/js/packages/dapp-playground/store.js
deleted file mode 100644
index c2d7cb929..000000000
--- a/js/packages/dapp-playground/store.js
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { action, computed, observable } from 'mobx';
-
-let instance = null;
-
-export default class PlaygroundStore {
- @observable components = [];
- @observable selectedIndex = 0;
-
- @computed get component () {
- return this.components[this.selectedIndex];
- }
-
- @action add (component) {
- this.components.push(component);
- }
-
- @action setSelectedIndex (selectedIndex) {
- this.selectedIndex = selectedIndex;
- }
-
- static get () {
- if (!instance) {
- instance = new PlaygroundStore();
- }
-
- return instance;
- }
-
- static register (component) {
- PlaygroundStore.get().add(component);
- }
-}
diff --git a/js/packages/dapp-playground/store.spec.js b/js/packages/dapp-playground/store.spec.js
deleted file mode 100644
index 697842b5f..000000000
--- a/js/packages/dapp-playground/store.spec.js
+++ /dev/null
@@ -1,34 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React from 'react';
-
-import QrCode from '@parity/ui/QrCode/qrCode.example';
-
-import PlaygroundStore from './store';
-
-describe('playground/store', () => {
- let store = PlaygroundStore.get();
-
- it('is available', () => {
- expect(PlaygroundStore.get()).to.be.ok;
- });
-
- it('adds new Components', () => {
- PlaygroundStore.register();
- expect(store.components.length).greaterThan(0);
- });
-});
diff --git a/js/packages/dapp-registry/Accounts/accounts.css b/js/packages/dapp-registry/Accounts/accounts.css
deleted file mode 100644
index d886138f0..000000000
--- a/js/packages/dapp-registry/Accounts/accounts.css
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.icon {
- /* TODO remove !important once material design lite is used */
- height: 30px !important;
- margin: 0 !important;
- padding: 0 !important;
- width: 30px !important;
-}
diff --git a/js/packages/dapp-registry/Accounts/accounts.js b/js/packages/dapp-registry/Accounts/accounts.js
deleted file mode 100644
index 983fc496f..000000000
--- a/js/packages/dapp-registry/Accounts/accounts.js
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import { connect } from 'react-redux';
-import { bindActionCreators } from 'redux';
-import AccountIcon from 'material-ui/svg-icons/action/account-circle';
-import PropTypes from 'prop-types';
-
-import { init } from './actions';
-import IdentityIcon from '../IdentityIcon';
-
-import styles from './accounts.css';
-
-class Accounts extends Component {
- static propTypes = {
- selected: PropTypes.oneOfType([
- PropTypes.oneOf([ null ]),
- PropTypes.string
- ]),
- onInit: PropTypes.func.isRequired
- };
-
- componentWillMount () {
- this.props.onInit();
- }
-
- render () {
- const { selected } = this.props;
-
- if (!selected) {
- return (
-
- );
- }
-
- return (
-
- );
- }
-}
-
-const mapStateToProps = (state) => state.accounts;
-const mapDispatchToProps = (dispatch) => bindActionCreators({
- onInit: init
-}, dispatch);
-
-export default connect(mapStateToProps, mapDispatchToProps)(Accounts);
diff --git a/js/packages/dapp-registry/Accounts/actions.js b/js/packages/dapp-registry/Accounts/actions.js
deleted file mode 100644
index 7f38de579..000000000
--- a/js/packages/dapp-registry/Accounts/actions.js
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { api } from '../parity';
-
-export const select = (address) => ({ type: 'accounts select', address });
-
-export const init = () => (dispatch) => {
- api.subscribe('parity_defaultAccount', (error, accountAddress) => {
- if (error) {
- return console.error(error);
- }
-
- if (accountAddress) {
- dispatch(select(accountAddress));
- }
- });
-
- return api.parity
- .defaultAccount()
- .then((accountAddress) => {
- dispatch(select(accountAddress));
- })
- .catch((error) => {
- console.error(error);
- });
-};
diff --git a/js/packages/dapp-registry/Accounts/index.js b/js/packages/dapp-registry/Accounts/index.js
deleted file mode 100644
index 027387e70..000000000
--- a/js/packages/dapp-registry/Accounts/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './accounts';
diff --git a/js/packages/dapp-registry/Application/application.css b/js/packages/dapp-registry/Application/application.css
deleted file mode 100644
index b9fac12ae..000000000
--- a/js/packages/dapp-registry/Application/application.css
+++ /dev/null
@@ -1,66 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.header {
- align-items: center;
- display: flex;
- justify-content: space-between;
- margin: 0;
- padding: 0.3em 1em;
- color: #fff;
- background-color: #333;
-}
-
-.header h1 {
- margin-top: 0;
- margin-bottom: 0;
- line-height: 50px;
- font-size: 200%;
- text-transform: uppercase;
-}
-
-.address {
- margin-bottom: 0;
- padding: 1rem;
- font-size: 80%;
- background-color: #f0f0f0;
-}
-
-.actions {
- margin: 1em;
-
- * {
- font-size: 1.3rem !important;
- }
-
- > * {
- padding-bottom: 0 !important;
- }
-}
-
-.warning {
- background: #f80;
- bottom: 0;
- color: #fff;
- cursor: pointer;
- left: 0;
- opacity: 1;
- padding: 1.5em;
- position: fixed;
- right: 50%;
- z-index: 100;
-}
diff --git a/js/packages/dapp-registry/Application/application.js b/js/packages/dapp-registry/Application/application.js
deleted file mode 100644
index a2485cea4..000000000
--- a/js/packages/dapp-registry/Application/application.js
+++ /dev/null
@@ -1,140 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-
-import getMuiTheme from 'material-ui/styles/getMuiTheme';
-import lightBaseTheme from 'material-ui/styles/baseThemes/lightBaseTheme';
-const muiTheme = getMuiTheme(lightBaseTheme);
-
-import CircularProgress from 'material-ui/CircularProgress';
-import { Card, CardText } from 'material-ui/Card';
-
-import { nullableProptype } from '@parity/shared/util/proptypes';
-
-import { api } from '../parity';
-
-import styles from './application.css';
-import Accounts from '../Accounts';
-import Events from '../Events';
-import Lookup from '../Lookup';
-import Names from '../Names';
-import Records from '../Records';
-import Reverse from '../Reverse';
-
-export default class Application extends Component {
- static childContextTypes = {
- muiTheme: PropTypes.object.isRequired,
- api: PropTypes.object.isRequired
- };
-
- getChildContext () {
- return { muiTheme, api };
- }
-
- static propTypes = {
- accounts: PropTypes.object.isRequired,
- contract: nullableProptype(PropTypes.object.isRequired),
- fee: nullableProptype(PropTypes.object.isRequired)
- };
-
- state = {
- showWarning: true
- };
-
- render () {
- const { contract, fee } = this.props;
- let warning = null;
-
- return (
-
-
- WARNING: The name registry is experimental. Please ensure that you understand the risks,
- benefits & consequences of registering a name before doing so.
-
- {
- fee && api.util.fromWei(fee).gt(0)
- ? (
-
- A non-refundable fee of { api.util.fromWei(fee).toFormat(3) } ETH
- is required for all registrations.
-
- )
- : null
- }
-
- );
- }
-
- handleHideWarning = () => {
- this.setState({ showWarning: false });
- }
-}
diff --git a/js/packages/dapp-registry/Application/index.js b/js/packages/dapp-registry/Application/index.js
deleted file mode 100644
index 3d8d1ca3b..000000000
--- a/js/packages/dapp-registry/Application/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './application';
diff --git a/js/packages/dapp-registry/Container.js b/js/packages/dapp-registry/Container.js
deleted file mode 100644
index c876e4740..000000000
--- a/js/packages/dapp-registry/Container.js
+++ /dev/null
@@ -1,69 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import { connect } from 'react-redux';
-import { bindActionCreators } from 'redux';
-import PropTypes from 'prop-types';
-
-import { nullableProptype } from '@parity/shared/util/proptypes';
-
-import Application from './Application';
-import * as actions from './actions';
-
-class Container extends Component {
- static propTypes = {
- actions: PropTypes.object.isRequired,
- accounts: PropTypes.object.isRequired,
- contacts: PropTypes.object.isRequired,
- contract: nullableProptype(PropTypes.object.isRequired),
- owner: nullableProptype(PropTypes.string.isRequired),
- fee: nullableProptype(PropTypes.object.isRequired),
- lookup: PropTypes.object.isRequired,
- events: PropTypes.object.isRequired
- };
-
- componentDidMount () {
- Promise.all([
- this.props.actions.fetchIsTestnet(),
- this.props.actions.addresses.fetch(),
- this.props.actions.fetchContract()
- ]).then(() => {
- this.props.actions.events.subscribe('Reserved');
- });
- }
-
- render () {
- return ();
- }
-}
-
-export default connect(
- // redux -> react connection
- (state) => state,
- // react -> redux connection
- (dispatch) => {
- const bound = bindActionCreators(actions, dispatch);
-
- bound.addresses = bindActionCreators(actions.addresses, dispatch);
- bound.accounts = bindActionCreators(actions.accounts, dispatch);
- bound.lookup = bindActionCreators(actions.lookup, dispatch);
- bound.events = bindActionCreators(actions.events, dispatch);
- bound.names = bindActionCreators(actions.names, dispatch);
- bound.records = bindActionCreators(actions.records, dispatch);
- return { actions: bound };
- }
-)(Container);
diff --git a/js/packages/dapp-registry/Events/actions.js b/js/packages/dapp-registry/Events/actions.js
deleted file mode 100644
index e1f316718..000000000
--- a/js/packages/dapp-registry/Events/actions.js
+++ /dev/null
@@ -1,102 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { api } from '../parity.js';
-
-export const start = (name, from, to) => ({ type: 'events subscribe start', name, from, to });
-export const fail = (name) => ({ type: 'events subscribe fail', name });
-export const success = (name, subscription) => ({ type: 'events subscribe success', name, subscription });
-
-export const event = (name, event) => ({ type: 'events event', name, event });
-
-export const subscribe = (name, from = 0, to = 'pending') =>
- (dispatch, getState) => {
- const { contract } = getState();
-
- if (!contract) {
- return;
- }
-
- const opt = { fromBlock: from, toBlock: to, limit: 50 };
-
- dispatch(start(name, from, to));
-
- contract
- .subscribe(name, opt, (error, events) => {
- if (error) {
- console.error(`error receiving events for ${name}`, error);
- return;
- }
-
- events.forEach((e) => {
- Promise.all([
- api.parity.getBlockHeaderByNumber(e.blockNumber),
- api.eth.getTransactionByHash(e.transactionHash)
- ])
- .then(([block, tx]) => {
- const data = {
- type: name,
- key: '' + e.transactionHash + e.logIndex,
- state: e.type,
- block: e.blockNumber,
- index: e.logIndex,
- transaction: e.transactionHash,
- from: tx.from,
- to: tx.to,
- parameters: e.params,
- timestamp: block.timestamp
- };
-
- dispatch(event(name, data));
- })
- .catch((err) => {
- console.error(`could not fetch block ${e.blockNumber}.`);
- console.error(err);
- });
- });
- })
- .then((subscriptionId) => {
- dispatch(success(name, subscriptionId));
- })
- .catch((error) => {
- console.error('event subscription failed', error);
- dispatch(fail(name));
- });
- };
-
-export const unsubscribe = (name) =>
- (dispatch, getState) => {
- const state = getState();
-
- if (!state.contract) {
- return;
- }
-
- const subscriptions = state.events.subscriptions;
-
- if (!(name in subscriptions) || subscriptions[name] === null) {
- return;
- }
-
- state.contract
- .unsubscribe(subscriptions[name])
- .then(() => {
- dispatch({ type: 'events unsubscribe', name });
- })
- .catch((error) => {
- console.error('event unsubscribe failed', error);
- });
- };
diff --git a/js/packages/dapp-registry/Events/events.css b/js/packages/dapp-registry/Events/events.css
deleted file mode 100644
index a7439c388..000000000
--- a/js/packages/dapp-registry/Events/events.css
+++ /dev/null
@@ -1,57 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.events {
- margin: 1em;
-}
-
-.options {
- margin: 0 .5em;
-}
-
-.reserved, .dropped, .dataChanged {
-}
-
-.reserved abbr, .dropped abbr {
- cursor: help;
-}
-
-.pending {
- opacity: .6;
-}
-
-.owner code {
- display: inline-block;
- vertical-align: top;
- line-height: 32px;
- word-wrap: break-word;
-}
-
-.eventsList {
- width: 100%;
- boder: none;
-}
-
-.eventsList td {
- padding: 0.25em 0.5em;
-}
-
-.inline {
- display: inline-block;
- width: auto;
- margin-right: 1em;
-}
diff --git a/js/packages/dapp-registry/Events/events.js b/js/packages/dapp-registry/Events/events.js
deleted file mode 100644
index 2b7a3a592..000000000
--- a/js/packages/dapp-registry/Events/events.js
+++ /dev/null
@@ -1,316 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import { connect } from 'react-redux';
-import { bindActionCreators } from 'redux';
-import { Card, CardHeader, CardActions, CardText } from 'material-ui/Card';
-import Toggle from 'material-ui/Toggle';
-import moment from 'moment';
-import PropTypes from 'prop-types';
-
-import { bytesToHex } from '../parity';
-import Hash from '../ui/hash';
-import Address from '../ui/address';
-
-import { subscribe, unsubscribe } from './actions';
-import styles from './events.css';
-
-const inlineButton = {
- display: 'inline-block',
- width: 'auto',
- marginRight: '1em'
-};
-
-const renderStatus = (timestamp, isPending) => {
- timestamp = moment(timestamp);
- if (isPending) {
- return (pending);
- }
- return (
-
- );
-};
-
-const renderEvent = (classNames, verb) => (e) => {
- const classes = e.state === 'pending'
- ? classNames + ' ' + styles.pending : classNames;
-
- return (
-
-
-
- );
- }
-
- onReservedToggle = (e, isToggled) => {
- const { pending, subscriptions, subscribe, unsubscribe } = this.props;
-
- if (!pending.Reserved) {
- if (isToggled && subscriptions.Reserved === null) {
- subscribe('Reserved');
- } else if (!isToggled && subscriptions.Reserved !== null) {
- unsubscribe('Reserved');
- }
- }
- };
-
- onDroppedToggle = (e, isToggled) => {
- const { pending, subscriptions, subscribe, unsubscribe } = this.props;
-
- if (!pending.Dropped) {
- if (isToggled && subscriptions.Dropped === null) {
- subscribe('Dropped');
- } else if (!isToggled && subscriptions.Dropped !== null) {
- unsubscribe('Dropped');
- }
- }
- };
-
- onDataChangedToggle = (e, isToggled) => {
- const { pending, subscriptions, subscribe, unsubscribe } = this.props;
-
- if (!pending.DataChanged) {
- if (isToggled && subscriptions.DataChanged === null) {
- subscribe('DataChanged');
- } else if (!isToggled && subscriptions.DataChanged !== null) {
- unsubscribe('DataChanged');
- }
- }
- };
-
- onReverseToggle = (e, isToggled) => {
- const { pending, subscriptions, subscribe, unsubscribe } = this.props;
-
- for (let e of ['ReverseProposed', 'ReverseConfirmed', 'ReverseRemoved']) {
- if (pending[e]) {
- continue;
- }
-
- if (isToggled && subscriptions[e] === null) {
- subscribe(e);
- } else if (!isToggled && subscriptions[e] !== null) {
- unsubscribe(e);
- }
- }
- };
-}
-
-const mapStateToProps = (state) => state.events;
-const mapDispatchToProps = (dispatch) => bindActionCreators({ subscribe, unsubscribe }, dispatch);
-
-export default connect(mapStateToProps, mapDispatchToProps)(Events);
diff --git a/js/packages/dapp-registry/Events/index.js b/js/packages/dapp-registry/Events/index.js
deleted file mode 100644
index a2c765eb5..000000000
--- a/js/packages/dapp-registry/Events/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './events.js';
diff --git a/js/packages/dapp-registry/Events/reducers.js b/js/packages/dapp-registry/Events/reducers.js
deleted file mode 100644
index 4d23e9123..000000000
--- a/js/packages/dapp-registry/Events/reducers.js
+++ /dev/null
@@ -1,90 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-const initialState = {
- subscriptions: {
- Reserved: null,
- Dropped: null,
- DataChanged: null,
- ReverseProposed: null,
- ReverseConfirmed: null,
- ReverseRemoved: null
- },
- pending: {
- Reserved: false,
- Dropped: false,
- DataChanged: false,
- ReverseProposed: false,
- ReverseConfirmed: false,
- ReverseRemoved: false
- },
- events: []
-};
-
-const sortEvents = (a, b) => {
- if (a.state === 'pending' && b.state !== 'pending') {
- return -1;
- } else if (a.state !== 'pending' && b.state === 'pending') {
- return 1;
- }
-
- const d = b.block.minus(a.block).toFixed(0);
-
- if (d === 0) {
- return b.index.minus(a.index).toFixed(0);
- }
-
- return d;
-};
-
-export default (state = initialState, action) => {
- if (!(action.name in state.subscriptions)) { // invalid event name
- return state;
- }
-
- if (action.type === 'events subscribe start') {
- return { ...state, pending: { ...state.pending, [action.name]: true } };
- }
- if (action.type === 'events subscribe fail') {
- return { ...state, pending: { ...state.pending, [action.name]: false } };
- }
- if (action.type === 'events subscribe success') {
- return {
- ...state,
- pending: { ...state.pending, [action.name]: false },
- subscriptions: { ...state.subscriptions, [action.name]: action.subscription }
- };
- }
-
- if (action.type === 'events unsubscribe') {
- return {
- ...state,
- pending: { ...state.pending, [action.name]: false },
- subscriptions: { ...state.subscriptions, [action.name]: null },
- events: state.events.filter((event) => event.type !== action.name)
- };
- }
-
- if (action.type === 'events event') {
- return { ...state, events: state.events
- .filter((event) => event.key !== action.event.key)
- .concat(action.event)
- .sort(sortEvents)
- };
- }
-
- return state;
-};
diff --git a/js/packages/dapp-registry/IdentityIcon/identityIcon.css b/js/packages/dapp-registry/IdentityIcon/identityIcon.css
deleted file mode 100644
index 01aba746d..000000000
--- a/js/packages/dapp-registry/IdentityIcon/identityIcon.css
+++ /dev/null
@@ -1,23 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.icon {
- width: 24px;
- height: 24px;
- border-radius: 50%;
- margin-right: 0.5em;
-}
diff --git a/js/packages/dapp-registry/IdentityIcon/identityIcon.js b/js/packages/dapp-registry/IdentityIcon/identityIcon.js
deleted file mode 100644
index 9adf8051b..000000000
--- a/js/packages/dapp-registry/IdentityIcon/identityIcon.js
+++ /dev/null
@@ -1,41 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-
-import { api } from '../parity';
-import styles from './identityIcon.css';
-
-export default class IdentityIcon extends Component {
- static propTypes = {
- address: PropTypes.string.isRequired,
- className: PropTypes.string,
- style: PropTypes.object
- }
-
- render () {
- const { address, className, style } = this.props;
-
- return (
-
- );
- }
-}
diff --git a/js/packages/dapp-registry/IdentityIcon/index.js b/js/packages/dapp-registry/IdentityIcon/index.js
deleted file mode 100644
index 091913564..000000000
--- a/js/packages/dapp-registry/IdentityIcon/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './identityIcon';
diff --git a/js/packages/dapp-registry/Lookup/actions.js b/js/packages/dapp-registry/Lookup/actions.js
deleted file mode 100644
index 514039272..000000000
--- a/js/packages/dapp-registry/Lookup/actions.js
+++ /dev/null
@@ -1,108 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { api, sha3 } from '../parity.js';
-import { getOwner } from '../util/registry';
-
-export const clear = () => ({ type: 'lookup clear' });
-
-export const lookupStart = (name, key) => ({ type: 'lookup start', name, key });
-export const reverseLookupStart = (address) => ({ type: 'reverseLookup start', address });
-export const ownerLookupStart = (name) => ({ type: 'ownerLookup start', name });
-
-export const success = (action, result) => ({ type: `${action} success`, result: result });
-
-export const fail = (action) => ({ type: `${action} error` });
-
-export const lookup = (name, key) => (dispatch, getState) => {
- const { contract } = getState();
-
- if (!contract) {
- return;
- }
-
- const method = key === 'A'
- ? contract.instance.getAddress
- : contract.instance.getData;
-
- name = name.toLowerCase();
- dispatch(lookupStart(name, key));
-
- method.call({}, [ sha3.text(name), key ])
- .then((result) => {
- if (key !== 'A') {
- result = api.util.bytesToHex(result);
- }
-
- dispatch(success('lookup', result));
- })
- .catch((err) => {
- console.error(`could not lookup ${key} for ${name}`);
- if (err) {
- console.error(err.stack);
- }
- dispatch(fail('lookup'));
- });
-};
-
-export const reverseLookup = (lookupAddress) => (dispatch, getState) => {
- const { contract } = getState();
-
- if (!contract) {
- return;
- }
-
- dispatch(reverseLookupStart(lookupAddress));
-
- contract.instance
- .reverse
- .call({}, [ lookupAddress ])
- .then((address) => {
- dispatch(success('reverseLookup', address));
- })
- .catch((err) => {
- console.error(`could not lookup reverse for ${lookupAddress}`);
- if (err) {
- console.error(err.stack);
- }
- dispatch(fail('reverseLookup'));
- });
-};
-
-export const ownerLookup = (name) => (dispatch, getState) => {
- const { contract } = getState();
-
- if (!contract) {
- return;
- }
-
- name = name.toLowerCase();
- dispatch(ownerLookupStart(name));
-
- return getOwner(contract, name)
- .then((owner) => {
- dispatch(success('ownerLookup', owner));
- })
- .catch((err) => {
- console.error(`could not lookup owner for ${name}`);
-
- if (err) {
- console.error(err.stack);
- }
-
- dispatch(fail('ownerLookup'));
- });
-};
diff --git a/js/packages/dapp-registry/Lookup/index.js b/js/packages/dapp-registry/Lookup/index.js
deleted file mode 100644
index 9e3166ec5..000000000
--- a/js/packages/dapp-registry/Lookup/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './lookup.js';
diff --git a/js/packages/dapp-registry/Lookup/lookup.css b/js/packages/dapp-registry/Lookup/lookup.css
deleted file mode 100644
index 135db0905..000000000
--- a/js/packages/dapp-registry/Lookup/lookup.css
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.lookup {
- margin: 1em;
-}
-
-.box {
- display: flex;
- margin: 0 1em;
- align-items: baseline;
-}
diff --git a/js/packages/dapp-registry/Lookup/lookup.js b/js/packages/dapp-registry/Lookup/lookup.js
deleted file mode 100644
index 71b4758b9..000000000
--- a/js/packages/dapp-registry/Lookup/lookup.js
+++ /dev/null
@@ -1,180 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import { connect } from 'react-redux';
-import { bindActionCreators } from 'redux';
-import { Card, CardHeader, CardText } from 'material-ui/Card';
-import RaisedButton from 'material-ui/RaisedButton';
-import SearchIcon from 'material-ui/svg-icons/action/search';
-import TextField from 'material-ui/TextField';
-import DropDownMenu from 'material-ui/DropDownMenu';
-import MenuItem from 'material-ui/MenuItem';
-import keycode from 'keycode';
-import PropTypes from 'prop-types';
-
-import { nullableProptype } from '@parity/shared/util/proptypes';
-
-import Address from '../ui/address.js';
-import renderImage from '../ui/image.js';
-
-import { clear, lookup, ownerLookup, reverseLookup } from './actions';
-import styles from './lookup.css';
-
-class Lookup extends Component {
- static propTypes = {
- result: nullableProptype(PropTypes.string.isRequired),
-
- clear: PropTypes.func.isRequired,
- lookup: PropTypes.func.isRequired,
- ownerLookup: PropTypes.func.isRequired,
- reverseLookup: PropTypes.func.isRequired
- }
-
- state = {
- input: '', type: 'A'
- };
-
- render () {
- const { input, type } = this.state;
- const { result } = this.props;
-
- return (
-
-
-
Keep in mind that this is most likely the hash of the content you are looking for.
-
- );
- }
-
- return (
- { result || 'No data' }
- );
- }
-
- onInputChange = (e) => {
- this.setState({ input: e.target.value });
- }
-
- onKeyDown = (event) => {
- const codeName = keycode(event);
-
- if (codeName !== 'enter') {
- return;
- }
-
- this.onLookupClick();
- }
-
- onTypeChange = (e, i, type) => {
- this.setState({ type });
- this.props.clear();
- }
-
- onLookupClick = () => {
- const { input, type } = this.state;
-
- if (type === 'reverse') {
- return this.props.reverseLookup(input);
- }
-
- if (type === 'owner') {
- return this.props.ownerLookup(input);
- }
-
- return this.props.lookup(input, type);
- }
-}
-
-const mapStateToProps = (state) => state.lookup;
-const mapDispatchToProps = (dispatch) =>
- bindActionCreators({
- clear, lookup, ownerLookup, reverseLookup
- }, dispatch);
-
-export default connect(mapStateToProps, mapDispatchToProps)(Lookup);
diff --git a/js/packages/dapp-registry/Lookup/reducers.js b/js/packages/dapp-registry/Lookup/reducers.js
deleted file mode 100644
index 0a8c2e486..000000000
--- a/js/packages/dapp-registry/Lookup/reducers.js
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { isStage } from '../util/actions';
-
-const initialState = {
- pending: false,
- result: null
-};
-
-export default (state = initialState, action) => {
- const { type } = action;
-
- if (!/^(lookup|reverseLookup|ownerLookup)/.test(type)) {
- return state;
- }
-
- if (isStage('clear', action)) {
- return { pending: state.pending, result: null };
- }
-
- if (isStage('start', action)) {
- return { pending: true, result: null };
- }
-
- if (isStage('error', action)) {
- return { pending: false, result: null };
- }
-
- if (isStage('success', action)) {
- return { pending: false, result: action.result };
- }
-
- return state;
-};
diff --git a/js/packages/dapp-registry/Names/actions.js b/js/packages/dapp-registry/Names/actions.js
deleted file mode 100644
index 9e5ff4fc6..000000000
--- a/js/packages/dapp-registry/Names/actions.js
+++ /dev/null
@@ -1,135 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { sha3, api } from '../parity.js';
-import { getOwner, isOwned } from '../util/registry';
-import postTx from '../util/post-tx';
-
-export const clearError = () => ({
- type: 'clearError'
-});
-
-const alreadyQueued = (queue, action, name) =>
- !!queue.find((entry) => entry.action === action && entry.name === name);
-
-export const reserveStart = (name) => ({ type: 'names reserve start', name });
-
-export const reserveSuccess = (name) => ({ type: 'names reserve success', name });
-
-export const reserveFail = (name, error) => ({ type: 'names reserve fail', name, error });
-
-export const reserve = (name) => (dispatch, getState) => {
- const state = getState();
- const accountAddress = state.accounts.selected;
- const contract = state.contract;
- const fee = state.fee;
-
- if (!contract || !accountAddress) {
- return;
- }
-
- name = name.toLowerCase();
-
- if (alreadyQueued(state.names.queue, 'reserve', name)) {
- return;
- }
-
- dispatch(reserveStart(name));
-
- return isOwned(contract, name)
- .then((owned) => {
- if (owned) {
- throw new Error(`"${name}" has already been reserved`);
- }
-
- const { reserve } = contract.instance;
-
- const options = {
- from: accountAddress,
- value: fee
- };
- const values = [
- sha3.text(name)
- ];
-
- return postTx(api, reserve, options, values);
- })
- .then((txHash) => {
- dispatch(reserveSuccess(name));
- })
- .catch((err) => {
- if (err.type !== 'REQUEST_REJECTED') {
- console.error(`error rerserving ${name}`, err);
- return dispatch(reserveFail(name, err));
- }
-
- dispatch(reserveFail(name));
- });
-};
-
-export const dropStart = (name) => ({ type: 'names drop start', name });
-
-export const dropSuccess = (name) => ({ type: 'names drop success', name });
-
-export const dropFail = (name, error) => ({ type: 'names drop fail', name, error });
-
-export const drop = (name) => (dispatch, getState) => {
- const state = getState();
- const accountAddress = state.accounts.selected;
- const contract = state.contract;
-
- if (!contract || !accountAddress) {
- return;
- }
-
- name = name.toLowerCase();
-
- if (alreadyQueued(state.names.queue, 'drop', name)) {
- return;
- }
-
- dispatch(dropStart(name));
-
- return getOwner(contract, name)
- .then((owner) => {
- if (owner.toLowerCase() !== accountAddress.toLowerCase()) {
- throw new Error(`you are not the owner of "${name}"`);
- }
-
- const { drop } = contract.instance;
-
- const options = {
- from: accountAddress
- };
-
- const values = [
- sha3.text(name)
- ];
-
- return postTx(api, drop, options, values);
- })
- .then((txhash) => {
- dispatch(dropSuccess(name));
- })
- .catch((err) => {
- if (err.type !== 'REQUEST_REJECTED') {
- console.error(`error dropping ${name}`, err);
- return dispatch(dropFail(name, err));
- }
-
- dispatch(dropFail(name));
- });
-};
diff --git a/js/packages/dapp-registry/Names/index.js b/js/packages/dapp-registry/Names/index.js
deleted file mode 100644
index dd9471827..000000000
--- a/js/packages/dapp-registry/Names/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './names.js';
diff --git a/js/packages/dapp-registry/Names/names.css b/js/packages/dapp-registry/Names/names.css
deleted file mode 100644
index cbbb33e60..000000000
--- a/js/packages/dapp-registry/Names/names.css
+++ /dev/null
@@ -1,46 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.names {
- margin: 1em;
-}
-
-.box {
- display: flex;
- align-items: baseline;
-}
-
-.spacing {
- margin-left: 1em;
-}
-
-.noSpacing {
- margin-top: 0;
-}
-
-.link {
- color: #00BCD4;
- text-decoration: none;
-
- &:hover {
- text-decoration: underline;
- }
-}
-
-.error {
- color: red;
-}
diff --git a/js/packages/dapp-registry/Names/names.js b/js/packages/dapp-registry/Names/names.js
deleted file mode 100644
index 5b00843ce..000000000
--- a/js/packages/dapp-registry/Names/names.js
+++ /dev/null
@@ -1,193 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import { connect } from 'react-redux';
-import { bindActionCreators } from 'redux';
-import { Card, CardHeader, CardText } from 'material-ui/Card';
-import TextField from 'material-ui/TextField';
-import DropDownMenu from 'material-ui/DropDownMenu';
-import MenuItem from 'material-ui/MenuItem';
-import RaisedButton from 'material-ui/RaisedButton';
-import CheckIcon from 'material-ui/svg-icons/navigation/check';
-import PropTypes from 'prop-types';
-
-import { nullableProptype } from '@parity/shared/util/proptypes';
-
-import { fromWei } from '../parity.js';
-
-import { clearError, reserve, drop } from './actions';
-import styles from './names.css';
-
-const useSignerText = (
Use the Signer to authenticate the following changes.
- );
- }
-
- onNameChange = (e) => {
- this.clearError();
- this.setState({ name: e.target.value });
- };
-
- onActionChange = (e, i, action) => {
- this.clearError();
- this.setState({ action });
- };
-
- onSubmitClick = () => {
- const { action, name } = this.state;
-
- if (action === 'reserve') {
- return this.props.reserve(name);
- }
-
- if (action === 'drop') {
- return this.props.drop(name);
- }
- };
-
- clearError = () => {
- if (this.props.error) {
- this.props.clearError();
- }
- };
-}
-
-const mapStateToProps = (state) => ({ ...state.names, fee: state.fee });
-const mapDispatchToProps = (dispatch) => bindActionCreators({ clearError, reserve, drop }, dispatch);
-
-export default connect(mapStateToProps, mapDispatchToProps)(Names);
diff --git a/js/packages/dapp-registry/Names/reducers.js b/js/packages/dapp-registry/Names/reducers.js
deleted file mode 100644
index 63a18e79d..000000000
--- a/js/packages/dapp-registry/Names/reducers.js
+++ /dev/null
@@ -1,75 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { isAction, isStage, addToQueue, removeFromQueue } from '../util/actions';
-
-const initialState = {
- error: null,
- pending: false,
- queue: []
-};
-
-export default (state = initialState, action) => {
- switch (action.type) {
- case 'clearError':
- return {
- ...state,
- error: null
- };
- }
-
- if (isAction('names', 'reserve', action)) {
- if (isStage('start', action)) {
- return {
- ...state,
- error: null,
- pending: true,
- queue: addToQueue(state.queue, 'reserve', action.name)
- };
- }
-
- if (isStage('success', action) || isStage('fail', action)) {
- return {
- ...state,
- error: action.error || null,
- pending: false,
- queue: removeFromQueue(state.queue, 'reserve', action.name)
- };
- }
- }
-
- if (isAction('names', 'drop', action)) {
- if (isStage('start', action)) {
- return {
- ...state,
- error: null,
- pending: true,
- queue: addToQueue(state.queue, 'drop', action.name)
- };
- }
-
- if (isStage('success', action) || isStage('fail', action)) {
- return {
- ...state,
- error: action.error || null,
- pending: false,
- queue: removeFromQueue(state.queue, 'drop', action.name)
- };
- }
- }
-
- return state;
-};
diff --git a/js/packages/dapp-registry/Records/actions.js b/js/packages/dapp-registry/Records/actions.js
deleted file mode 100644
index 4b7ef51d1..000000000
--- a/js/packages/dapp-registry/Records/actions.js
+++ /dev/null
@@ -1,75 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { sha3, api } from '../parity.js';
-import postTx from '../util/post-tx';
-import { getOwner } from '../util/registry';
-
-export const clearError = () => ({
- type: 'clearError'
-});
-
-export const start = (name, key, value) => ({ type: 'records update start', name, key, value });
-
-export const success = () => ({ type: 'records update success' });
-
-export const fail = (error) => ({ type: 'records update fail', error });
-
-export const update = (name, key, value) => (dispatch, getState) => {
- const state = getState();
- const accountAddress = state.accounts.selected;
- const contract = state.contract;
-
- if (!contract || !accountAddress) {
- return;
- }
-
- name = name.toLowerCase();
- dispatch(start(name, key, value));
-
- return getOwner(contract, name)
- .then((owner) => {
- if (owner.toLowerCase() !== accountAddress.toLowerCase()) {
- throw new Error(`you are not the owner of "${name}"`);
- }
-
- const method = key === 'A'
- ? contract.instance.setAddress
- : contract.instance.setData || contract.instance.set;
-
- const options = {
- from: accountAddress
- };
-
- const values = [
- sha3.text(name),
- key,
- value
- ];
-
- return postTx(api, method, options, values);
- })
- .then((txHash) => {
- dispatch(success());
- }).catch((err) => {
- if (err.type !== 'REQUEST_REJECTED') {
- console.error(`error updating ${name}`, err);
- return dispatch(fail(err));
- }
-
- dispatch(fail());
- });
-};
diff --git a/js/packages/dapp-registry/Records/index.js b/js/packages/dapp-registry/Records/index.js
deleted file mode 100644
index e2528968e..000000000
--- a/js/packages/dapp-registry/Records/index.js
+++ /dev/null
@@ -1 +0,0 @@
-export default from './records.js';
diff --git a/js/packages/dapp-registry/Records/records.css b/js/packages/dapp-registry/Records/records.css
deleted file mode 100644
index a94f222c7..000000000
--- a/js/packages/dapp-registry/Records/records.css
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.records {
- margin: 1em;
-}
-
-.noSpacing {
- margin-top: 0;
-}
-
-.box {
- display: flex;
- align-items: baseline;
-}
-
-.spacing {
- margin-left: 1em;
-}
-
-.button {
- flex-grow: 0;
- flex-shrink: 0;
-}
-
-.error {
- color: red;
-}
diff --git a/js/packages/dapp-registry/Records/records.js b/js/packages/dapp-registry/Records/records.js
deleted file mode 100644
index 9a120781a..000000000
--- a/js/packages/dapp-registry/Records/records.js
+++ /dev/null
@@ -1,139 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import { connect } from 'react-redux';
-import { bindActionCreators } from 'redux';
-import { Card, CardHeader, CardText } from 'material-ui/Card';
-import TextField from 'material-ui/TextField';
-import DropDownMenu from 'material-ui/DropDownMenu';
-import MenuItem from 'material-ui/MenuItem';
-import RaisedButton from 'material-ui/RaisedButton';
-import SaveIcon from 'material-ui/svg-icons/content/save';
-import PropTypes from 'prop-types';
-
-import { nullableProptype } from '@parity/shared/util/proptypes';
-
-import { clearError, update } from './actions';
-import styles from './records.css';
-
-class Records extends Component {
- static propTypes = {
- error: nullableProptype(PropTypes.object.isRequired),
- pending: PropTypes.bool.isRequired,
- name: PropTypes.string.isRequired,
- type: PropTypes.string.isRequired,
- value: PropTypes.string.isRequired,
-
- clearError: PropTypes.func.isRequired,
- update: PropTypes.func.isRequired
- }
-
- state = { name: '', type: 'A', value: '' };
-
- render () {
- const { pending } = this.props;
- const name = this.state.name || this.props.name;
- const type = this.state.type || this.props.type;
- const value = this.state.value || this.props.value;
-
- return (
-
-
-
-
- You can only modify entries of names that you previously registered.
-
- );
- }
-
- onNameChange = (e) => {
- this.clearError();
- this.setState({ name: e.target.value });
- };
-
- onTypeChange = (e, i, type) => {
- this.setState({ type });
- };
-
- onValueChange = (e) => {
- this.setState({ value: e.target.value });
- };
-
- onSaveClick = () => {
- const { name, type, value } = this.state;
-
- this.props.update(name, type, value);
- };
-
- clearError = () => {
- if (this.props.error) {
- this.props.clearError();
- }
- };
-}
-
-const mapStateToProps = (state) => state.records;
-const mapDispatchToProps = (dispatch) => bindActionCreators({ clearError, update }, dispatch);
-
-export default connect(mapStateToProps, mapDispatchToProps)(Records);
diff --git a/js/packages/dapp-registry/Records/reducers.js b/js/packages/dapp-registry/Records/reducers.js
deleted file mode 100644
index 08042d63c..000000000
--- a/js/packages/dapp-registry/Records/reducers.js
+++ /dev/null
@@ -1,55 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { isAction, isStage } from '../util/actions';
-
-const initialState = {
- error: null,
- pending: false,
- name: '', type: '', value: ''
-};
-
-export default (state = initialState, action) => {
- switch (action.type) {
- case 'clearError':
- return {
- ...state,
- error: null
- };
- }
-
- if (!isAction('records', 'update', action)) {
- return state;
- }
-
- if (isStage('start', action)) {
- return {
- ...state, pending: true,
- error: null,
- name: action.name, type: action.key, value: action.value
- };
- }
-
- if (isStage('success', action) || isStage('fail', action)) {
- return {
- ...state, pending: false,
- error: action.error || null,
- name: initialState.name, type: initialState.type, value: initialState.value
- };
- }
-
- return state;
-};
diff --git a/js/packages/dapp-registry/Reverse/actions.js b/js/packages/dapp-registry/Reverse/actions.js
deleted file mode 100644
index f78ff3434..000000000
--- a/js/packages/dapp-registry/Reverse/actions.js
+++ /dev/null
@@ -1,117 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { api } from '../parity.js';
-import postTx from '../util/post-tx';
-import { getOwner } from '../util/registry';
-
-export const clearError = () => ({
- type: 'clearError'
-});
-
-export const start = (action, name, address) => ({ type: `reverse ${action} start`, name, address });
-
-export const success = (action) => ({ type: `reverse ${action} success` });
-
-export const fail = (action, error) => ({ type: `reverse ${action} fail`, error });
-
-export const propose = (name, address) => (dispatch, getState) => {
- const state = getState();
- const accountAddress = state.accounts.selected;
- const contract = state.contract;
-
- if (!contract || !accountAddress) {
- return;
- }
-
- name = name.toLowerCase();
- dispatch(start('propose', name, address));
-
- return getOwner(contract, name)
- .then((owner) => {
- if (owner.toLowerCase() !== accountAddress.toLowerCase()) {
- throw new Error(`you are not the owner of "${name}"`);
- }
-
- const { proposeReverse } = contract.instance;
-
- const options = {
- from: accountAddress
- };
-
- const values = [
- name,
- address
- ];
-
- return postTx(api, proposeReverse, options, values);
- })
- .then((txHash) => {
- dispatch(success('propose'));
- })
- .catch((err) => {
- if (err.type !== 'REQUEST_REJECTED') {
- console.error(`error proposing ${name}`, err);
- return dispatch(fail('propose', err));
- }
-
- dispatch(fail('propose'));
- });
-};
-
-export const confirm = (name) => (dispatch, getState) => {
- const state = getState();
- const accountAddress = state.accounts.selected;
- const contract = state.contract;
-
- if (!contract || !accountAddress) {
- return;
- }
-
- name = name.toLowerCase();
- dispatch(start('confirm', name));
-
- return getOwner(contract, name)
- .then((owner) => {
- if (owner.toLowerCase() !== accountAddress.toLowerCase()) {
- throw new Error(`you are not the owner of "${name}"`);
- }
-
- const { confirmReverse } = contract.instance;
-
- const options = {
- from: accountAddress
- };
-
- const values = [
- name
- ];
-
- return postTx(api, confirmReverse, options, values);
- })
- .then((txHash) => {
- dispatch(success('confirm'));
- })
- .catch((err) => {
- if (err.type !== 'REQUEST_REJECTED') {
- console.error(`error confirming ${name}`, err);
- return dispatch(fail('confirm', err));
- }
-
- dispatch(fail('confirm'));
- });
-};
-
diff --git a/js/packages/dapp-registry/Reverse/index.js b/js/packages/dapp-registry/Reverse/index.js
deleted file mode 100644
index ecaf9c3db..000000000
--- a/js/packages/dapp-registry/Reverse/index.js
+++ /dev/null
@@ -1 +0,0 @@
-export default from './reverse';
diff --git a/js/packages/dapp-registry/Reverse/reducers.js b/js/packages/dapp-registry/Reverse/reducers.js
deleted file mode 100644
index 51b44ab6f..000000000
--- a/js/packages/dapp-registry/Reverse/reducers.js
+++ /dev/null
@@ -1,85 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { isAction, isStage } from '../util/actions';
-
-const initialState = {
- error: null,
- pending: false,
- queue: []
-};
-
-export default (state = initialState, action) => {
- switch (action.type) {
- case 'clearError':
- return {
- ...state,
- error: null
- };
- }
-
- if (isAction('reverse', 'propose', action)) {
- if (isStage('start', action)) {
- return {
- ...state, pending: true,
- error: null,
- queue: state.queue.concat({
- action: 'propose',
- name: action.name,
- address: action.address
- })
- };
- }
-
- if (isStage('success', action) || isStage('fail', action)) {
- return {
- ...state, pending: false,
- error: action.error || null,
- queue: state.queue.filter((e) =>
- e.action === 'propose' &&
- e.name === action.name &&
- e.address === action.address
- )
- };
- }
- }
-
- if (isAction('reverse', 'confirm', action)) {
- if (isStage('start', action)) {
- return {
- ...state, pending: true,
- error: null,
- queue: state.queue.concat({
- action: 'confirm',
- name: action.name
- })
- };
- }
-
- if (isStage('success', action) || isStage('fail', action)) {
- return {
- ...state, pending: false,
- error: action.error || null,
- queue: state.queue.filter((e) =>
- e.action === 'confirm' &&
- e.name === action.name
- )
- };
- }
- }
-
- return state;
-};
diff --git a/js/packages/dapp-registry/Reverse/reverse.css b/js/packages/dapp-registry/Reverse/reverse.css
deleted file mode 100644
index fc2089d5e..000000000
--- a/js/packages/dapp-registry/Reverse/reverse.css
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.reverse {
- margin: 1em;
-}
-
-.noSpacing {
- margin-top: 0;
-}
-
-.box {
- display: flex;
- align-items: baseline;
-}
-
-.spacing {
- margin-right: 1em;
-}
-
-.button {
- flex-grow: 0;
- flex-shrink: 0;
-}
-
-.error {
- color: red;
-}
diff --git a/js/packages/dapp-registry/Reverse/reverse.js b/js/packages/dapp-registry/Reverse/reverse.js
deleted file mode 100644
index d772eb693..000000000
--- a/js/packages/dapp-registry/Reverse/reverse.js
+++ /dev/null
@@ -1,164 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import { connect } from 'react-redux';
-import { bindActionCreators } from 'redux';
-import {
- Card, CardHeader, CardText, TextField, DropDownMenu, MenuItem, RaisedButton
-} from 'material-ui';
-import PropTypes from 'prop-types';
-
-import { nullableProptype } from '@parity/shared/util/proptypes';
-import { AddIcon, CheckIcon } from '@parity/ui/Icons';
-
-import { clearError, confirm, propose } from './actions';
-import styles from './reverse.css';
-
-class Reverse extends Component {
- static propTypes = {
- error: nullableProptype(PropTypes.object.isRequired),
- pending: PropTypes.bool.isRequired,
- queue: PropTypes.array.isRequired,
-
- clearError: PropTypes.func.isRequired,
- confirm: PropTypes.func.isRequired,
- propose: PropTypes.func.isRequired
- }
-
- state = {
- action: 'propose',
- name: '',
- address: ''
- };
-
- render () {
- const { pending } = this.props;
- const { action, address, name } = this.state;
-
- const explanation = action === 'propose'
- ? (
-
- To propose a reverse entry for foo, you have to be the owner of it.
-
- ) : (
-
- To confirm a proposal, send the transaction from the account that the name has been proposed for.
-
- );
- }
-
- onNameChange = (e) => {
- this.setState({ name: e.target.value });
- };
-
- onAddressChange = (e) => {
- this.setState({ address: e.target.value });
- };
-
- onActionChange = (e, i, action) => {
- this.setState({ action });
- };
-
- onSubmitClick = () => {
- const { action, name, address } = this.state;
-
- if (action === 'propose') {
- this.props.propose(name, address);
- } else if (action === 'confirm') {
- this.props.confirm(name);
- }
- };
-
- clearError = () => {
- if (this.props.error) {
- this.props.clearError();
- }
- };
-}
-
-const mapStateToProps = (state) => state.reverse;
-const mapDispatchToProps = (dispatch) => bindActionCreators({ clearError, confirm, propose }, dispatch);
-
-export default connect(mapStateToProps, mapDispatchToProps)(Reverse);
diff --git a/js/packages/dapp-registry/actions.js b/js/packages/dapp-registry/actions.js
deleted file mode 100644
index 4642c2967..000000000
--- a/js/packages/dapp-registry/actions.js
+++ /dev/null
@@ -1,95 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import Contracts from '@parity/shared/contracts';
-
-import { api } from './parity.js';
-import * as addresses from './addresses/actions.js';
-import * as accounts from './Accounts/actions.js';
-import * as lookup from './Lookup/actions.js';
-import * as events from './Events/actions.js';
-import * as names from './Names/actions.js';
-import * as records from './Records/actions.js';
-import * as reverse from './Reverse/actions.js';
-
-export { addresses, accounts, lookup, events, names, records, reverse };
-
-export const setNetVersion = (netVersion) => ({ type: 'set netVersion', netVersion });
-
-export const fetchIsTestnet = () => (dispatch) =>
- api.net.version()
- .then((netVersion) => {
- dispatch(setNetVersion(netVersion));
- })
- .catch((err) => {
- console.error('could not check if testnet');
- if (err) {
- console.error(err.stack);
- }
- });
-
-export const setContract = (contract) => ({ type: 'set contract', contract });
-
-export const fetchContract = () => (dispatch) => {
- return Contracts.get(api).registry
- .fetchContract()
- .then((contract) => {
- dispatch(setContract(contract));
- dispatch(fetchFee());
- dispatch(fetchOwner());
- })
- .catch((error) => {
- console.error('could not fetch contract', error);
- });
-};
-
-export const setFee = (fee) => ({ type: 'set fee', fee });
-
-const fetchFee = () => (dispatch, getState) => {
- const { contract } = getState();
-
- if (!contract) {
- return;
- }
-
- contract.instance.fee.call()
- .then((fee) => dispatch(setFee(fee)))
- .catch((err) => {
- console.error('could not fetch fee');
- if (err) {
- console.error(err.stack);
- }
- });
-};
-
-export const setOwner = (owner) => ({ type: 'set owner', owner });
-
-export const fetchOwner = () => (dispatch, getState) => {
- const { contract } = getState();
-
- if (!contract) {
- return;
- }
-
- contract.instance.owner.call()
- .then((owner) => dispatch(setOwner(owner)))
- .catch((err) => {
- console.error('could not fetch owner');
- if (err) {
- console.error(err.stack);
- }
- });
-};
diff --git a/js/packages/dapp-registry/addresses/accounts-reducer.js b/js/packages/dapp-registry/addresses/accounts-reducer.js
deleted file mode 100644
index 2ff11ae27..000000000
--- a/js/packages/dapp-registry/addresses/accounts-reducer.js
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-const initialState = {
- all: {},
- selected: null
-};
-
-export default (state = initialState, action) => {
- if (action.type === 'addresses set') {
- const accounts = action.addresses
- .filter((address) => address.isAccount)
- .reduce((accounts, account) => {
- accounts[account.address] = account;
- return accounts;
- }, {});
-
- return { ...state, all: accounts };
- }
-
- if (action.type === 'accounts select') {
- return { ...state, selected: action.address };
- }
-
- return state;
-};
diff --git a/js/packages/dapp-registry/addresses/actions.js b/js/packages/dapp-registry/addresses/actions.js
deleted file mode 100644
index 0c0817f97..000000000
--- a/js/packages/dapp-registry/addresses/actions.js
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { api } from '../parity';
-
-export const set = (addresses) => ({ type: 'addresses set', addresses });
-
-export const fetch = () => (dispatch) => {
- return api.parity
- .accountsInfo()
- .then((accountsInfo) => {
- const addresses = Object
- .keys(accountsInfo)
- .map((address) => ({
- ...accountsInfo[address],
- address,
- isAccount: true
- }));
-
- dispatch(set(addresses));
- })
- .catch((error) => {
- console.error('could not fetch addresses', error);
- });
-};
diff --git a/js/packages/dapp-registry/addresses/contacts-reducer.js b/js/packages/dapp-registry/addresses/contacts-reducer.js
deleted file mode 100644
index 80880a923..000000000
--- a/js/packages/dapp-registry/addresses/contacts-reducer.js
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-const initialState = {};
-
-export default (state = initialState, action) => {
- if (action.type === 'addresses set') {
- const contacts = action.addresses
- .filter((address) => !address.isAccount)
- .reduce((contacts, contact) => {
- contacts[contact.address] = contact;
- return contacts;
- }, {});
-
- return contacts;
- }
-
- return state;
-};
diff --git a/js/packages/dapp-registry/index.js b/js/packages/dapp-registry/index.js
deleted file mode 100644
index 54e631ff2..000000000
--- a/js/packages/dapp-registry/index.js
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React from 'react';
-import ReactDOM from 'react-dom';
-import { Provider } from 'react-redux';
-
-import injectTapEventPlugin from 'react-tap-event-plugin';
-injectTapEventPlugin();
-
-import store from './store';
-import Container from './Container';
-
-import '@parity/shared/assets/fonts/Roboto/font.css';
-import '@parity/shared/assets/fonts/RobotoMono/font.css';
-import '@parity/dapps/style.css';
-
-ReactDOM.render(
-
-
- ,
- document.querySelector('#container')
-);
-
-if (module.hot) {
- module.hot.accept('./Container', () => {
- require('./Container');
-
- ReactDOM.render(
-
-
- ,
- document.querySelector('#container')
- );
- });
-}
diff --git a/js/packages/dapp-registry/package.json b/js/packages/dapp-registry/package.json
deleted file mode 100644
index 2d31d710c..000000000
--- a/js/packages/dapp-registry/package.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "name": "@parity/dapp-registry",
- "description": "Parity registry dapp",
- "version": "1.99.99",
- "main": "index.js",
- "author": "Parity Team ",
- "maintainers": [],
- "contributors": [],
- "license": "GPL-3.0",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/paritytech/dapp-registry.git"
- },
- "keywords": [],
- "scripts": {},
- "devDependencies": {},
- "dependencies": {
- },
- "peerDependencies": {}
-}
diff --git a/js/packages/dapp-registry/parity.js b/js/packages/dapp-registry/parity.js
deleted file mode 100644
index a45a16c1e..000000000
--- a/js/packages/dapp-registry/parity.js
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import Api from '@parity/api';
-
-const ethereumProvider = window.ethereum || window.parent.ethereum;
-
-if (!ethereumProvider) {
- throw new Error('Unable to locate EthereumProvider, object not attached');
-}
-
-const api = new Api(ethereumProvider);
-const { bytesToHex, sha3, toWei, fromWei } = api.util;
-
-export {
- api,
- bytesToHex, sha3, toWei, fromWei
-};
diff --git a/js/packages/dapp-registry/reducers.js b/js/packages/dapp-registry/reducers.js
deleted file mode 100644
index 6d0816273..000000000
--- a/js/packages/dapp-registry/reducers.js
+++ /dev/null
@@ -1,63 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import accountsReducer from './addresses/accounts-reducer.js';
-import contactsReducer from './addresses/contacts-reducer.js';
-import lookupReducer from './Lookup/reducers.js';
-import eventsReducer from './Events/reducers.js';
-import namesReducer from './Names/reducers.js';
-import recordsReducer from './Records/reducers.js';
-import reverseReducer from './Reverse/reducers.js';
-
-const netVersionReducer = (state = null, action) =>
- action.type === 'set netVersion' ? action.netVersion : state;
-
-const contractReducer = (state = null, action) =>
- action.type === 'set contract' ? action.contract : state;
-
-const feeReducer = (state = null, action) =>
- action.type === 'set fee' ? action.fee : state;
-
-const ownerReducer = (state = null, action) =>
- action.type === 'set owner' ? action.owner : state;
-
-const initialState = {
- netVersion: netVersionReducer(undefined, { type: '' }),
- accounts: accountsReducer(undefined, { type: '' }),
- contacts: contactsReducer(undefined, { type: '' }),
- contract: contractReducer(undefined, { type: '' }),
- fee: feeReducer(undefined, { type: '' }),
- owner: ownerReducer(undefined, { type: '' }),
- lookup: lookupReducer(undefined, { type: '' }),
- events: eventsReducer(undefined, { type: '' }),
- names: namesReducer(undefined, { type: '' }),
- records: recordsReducer(undefined, { type: '' }),
- reverse: reverseReducer(undefined, { type: '' })
-};
-
-export default (state = initialState, action) => ({
- netVersion: netVersionReducer(state.netVersion, action),
- accounts: accountsReducer(state.accounts, action),
- contacts: contactsReducer(state.contacts, action),
- contract: contractReducer(state.contract, action),
- fee: feeReducer(state.fee, action),
- owner: ownerReducer(state.owner, action),
- lookup: lookupReducer(state.lookup, action),
- events: eventsReducer(state.events, action),
- names: namesReducer(state.names, action),
- records: recordsReducer(state.records, action),
- reverse: reverseReducer(state.reverse, action)
-});
diff --git a/js/packages/dapp-registry/store.js b/js/packages/dapp-registry/store.js
deleted file mode 100644
index ced7a5bae..000000000
--- a/js/packages/dapp-registry/store.js
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { createStore, applyMiddleware } from 'redux';
-import thunk from 'redux-thunk';
-
-import reducer from './reducers';
-
-export default createStore(reducer, applyMiddleware(thunk));
diff --git a/js/packages/dapp-registry/ui/address.css b/js/packages/dapp-registry/ui/address.css
deleted file mode 100644
index 89a140348..000000000
--- a/js/packages/dapp-registry/ui/address.css
+++ /dev/null
@@ -1,41 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.container {
- display: inline-block;
- vertical-align: middle;
- line-height: 24px;
-}
-
-.align {
- display: inline-block;
- vertical-align: top;
- line-height: 24px;
-}
-
-.link {
- text-decoration: none;
- color: inherit;
-
- &:hover {
- text-decoration: underline;
- }
-
- & abbr {
- text-decoration: inherit;
- }
-}
diff --git a/js/packages/dapp-registry/ui/address.js b/js/packages/dapp-registry/ui/address.js
deleted file mode 100644
index a73a2b8e5..000000000
--- a/js/packages/dapp-registry/ui/address.js
+++ /dev/null
@@ -1,122 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import { connect } from 'react-redux';
-import PropTypes from 'prop-types';
-
-import { nullableProptype } from '@parity/shared/util/proptypes';
-
-import Hash from './hash';
-import etherscanUrl from '../util/etherscan-url';
-import IdentityIcon from '../IdentityIcon';
-
-import styles from './address.css';
-
-class Address extends Component {
- static propTypes = {
- address: PropTypes.string.isRequired,
- account: nullableProptype(PropTypes.object.isRequired),
- netVersion: PropTypes.string.isRequired,
- key: PropTypes.string,
- shortenHash: PropTypes.bool
- };
-
- static defaultProps = {
- key: 'address',
- shortenHash: true
- };
-
- render () {
- const { address, key } = this.props;
-
- return (
-
-
- { this.renderCaption() }
-
- );
- }
-
- renderCaption () {
- const { address, account, netVersion, shortenHash } = this.props;
-
- if (account) {
- const { name } = account;
-
- return (
-
-
- { name || address }
-
-
- );
- }
-
- return (
-
- { shortenHash ? (
-
- ) : address }
-
- );
- }
-}
-
-function mapStateToProps (initState, initProps) {
- const { accounts, contacts } = initState;
-
- const allAccounts = Object.assign({}, accounts.all, contacts);
-
- // Add lower case addresses to map
- Object
- .keys(allAccounts)
- .forEach((address) => {
- allAccounts[address.toLowerCase()] = allAccounts[address];
- });
-
- return (state, props) => {
- const { netVersion } = state;
- const { address = '' } = props;
-
- const account = allAccounts[address] || null;
-
- return {
- account,
- netVersion
- };
- };
-}
-
-export default connect(
- mapStateToProps
-)(Address);
diff --git a/js/packages/dapp-registry/ui/hash.css b/js/packages/dapp-registry/ui/hash.css
deleted file mode 100644
index d44e2d286..000000000
--- a/js/packages/dapp-registry/ui/hash.css
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.link {
- text-decoration: none;
- color: inherit;
-
- &:hover {
- text-decoration: underline;
- }
-}
diff --git a/js/packages/dapp-registry/ui/hash.js b/js/packages/dapp-registry/ui/hash.js
deleted file mode 100644
index 478442deb..000000000
--- a/js/packages/dapp-registry/ui/hash.js
+++ /dev/null
@@ -1,68 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import { connect } from 'react-redux';
-import PropTypes from 'prop-types';
-
-import etherscanUrl from '../util/etherscan-url';
-
-import styles from './hash.css';
-
-const leading0x = /^0x/;
-
-class Hash extends Component {
- static propTypes = {
- hash: PropTypes.string.isRequired,
- netVersion: PropTypes.string.isRequired,
- linked: PropTypes.bool
- }
-
- static defaultProps = {
- linked: false
- }
-
- render () {
- const { hash, netVersion, linked } = this.props;
-
- let shortened = hash.toLowerCase().replace(leading0x, '');
-
- shortened = shortened.length > (6 + 6)
- ? shortened.substr(0, 6) + '...' + shortened.slice(-6)
- : shortened;
-
- if (linked) {
- return (
-
- { shortened }
-
- );
- }
-
- return ({ shortened });
- }
-}
-
-export default connect(
- (state) => ({ // mapStateToProps
- netVersion: state.netVersion
- }),
- null // mapDispatchToProps
-)(Hash);
diff --git a/js/packages/dapp-registry/ui/image.js b/js/packages/dapp-registry/ui/image.js
deleted file mode 100644
index 88cae4e30..000000000
--- a/js/packages/dapp-registry/ui/image.js
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React from 'react';
-
-const styles = {
- padding: '.5em',
- border: '1px solid #777'
-};
-
-export default (address) => {
- if (!address || /^(0x)?0*$/.test(address)) {
- return (
-
- No image
-
- );
- }
-
- return (
-
- );
-};
diff --git a/js/packages/dapp-registry/util/actions.js b/js/packages/dapp-registry/util/actions.js
deleted file mode 100644
index c152848bc..000000000
--- a/js/packages/dapp-registry/util/actions.js
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export const isAction = (ns, type, action) => {
- return action.type.slice(0, ns.length + 1 + type.length) === `${ns} ${type}`;
-};
-
-export const isStage = (stage, action) => {
- return (new RegExp(`${stage}$`)).test(action.type);
-};
-
-export const addToQueue = (queue, action, name) => {
- return queue.concat({ action, name });
-};
-
-export const removeFromQueue = (queue, action, name) => {
- return queue.filter((e) => !(e.action === action && e.name === name));
-};
diff --git a/js/packages/dapp-registry/util/etherscan-url.js b/js/packages/dapp-registry/util/etherscan-url.js
deleted file mode 100644
index 265cf6a19..000000000
--- a/js/packages/dapp-registry/util/etherscan-url.js
+++ /dev/null
@@ -1,28 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { url as externalUrl } from '@parity/etherscan/links';
-
-const leading0x = /^0x/;
-
-const etherscanUrl = (hash, isTestnet, netVersion) => {
- hash = hash.toLowerCase().replace(leading0x, '');
- const type = hash.length === 40 ? 'address' : 'tx';
-
- return `${externalUrl(isTestnet, netVersion)}/${type}/0x${hash}`;
-};
-
-export default etherscanUrl;
diff --git a/js/packages/dapp-registry/util/post-tx.js b/js/packages/dapp-registry/util/post-tx.js
deleted file mode 100644
index 46fdb1403..000000000
--- a/js/packages/dapp-registry/util/post-tx.js
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-const postTx = (api, method, opt = {}, values = []) => {
- opt = Object.assign({}, opt);
-
- return method.estimateGas(opt, values)
- .then((gas) => {
- opt.gas = gas.mul(1.2).toFixed(0);
- return method.postTransaction(opt, values);
- })
- .then((reqId) => {
- return api.pollMethod('parity_checkRequest', reqId);
- });
-};
-
-export default postTx;
diff --git a/js/packages/dapp-registry/util/registry.js b/js/packages/dapp-registry/util/registry.js
deleted file mode 100644
index b818966dc..000000000
--- a/js/packages/dapp-registry/util/registry.js
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export const getOwner = (contract, name) => {
- const { address, api } = contract;
-
- const key = api.util.sha3.text(name) + '0000000000000000000000000000000000000000000000000000000000000001';
- const position = api.util.sha3(key, { encoding: 'hex' });
-
- return api
- .eth
- .getStorageAt(address, position)
- .then((result) => {
- if (/^(0x)?0*$/.test(result)) {
- return '';
- }
-
- return '0x' + result.slice(-40);
- });
-};
-
-export const isOwned = (contract, name) => {
- return getOwner(contract, name).then((owner) => !!owner);
-};
diff --git a/js/packages/dapp-settings/Background/background.css b/js/packages/dapp-settings/Background/background.css
deleted file mode 100644
index 09e96491c..000000000
--- a/js/packages/dapp-settings/Background/background.css
+++ /dev/null
@@ -1,46 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.bgcontainer {
- display: flex;
- flex-direction: row;
- flex-wrap: wrap;
-}
-
-.bgflex {
- flex-basis: 25%;
- box-sizing: border-box;
- display: inline-block;
- padding: 0 0.5em 1em 0.5em;
-}
-
-.bgseed {
- background: black;
- border-radius: 4px;
-}
-
-.seed,
-.seedactive {
- height: 10em;
- border-radius: 4px;
- cursor: pointer;
- border: 2px solid rgba(255, 255, 255, 1);
-}
-
-.seed {
- opacity: 0.5;
-}
diff --git a/js/packages/dapp-settings/Background/background.js b/js/packages/dapp-settings/Background/background.js
deleted file mode 100644
index 923e4edca..000000000
--- a/js/packages/dapp-settings/Background/background.js
+++ /dev/null
@@ -1,165 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-import { connect } from 'react-redux';
-import { bindActionCreators } from 'redux';
-
-import { updateBackground } from '@parity/shared/redux/providers/settings/actions';
-import { Button, Container, ParityBackground } from '@parity/ui';
-import { RefreshIcon } from '@parity/ui/Icons';
-
-import layout from '../layout.css';
-import styles from './background.css';
-
-let counter = 0;
-
-class Background extends Component {
- static contextTypes = {
- api: PropTypes.object.isRequired
- }
-
- static propTypes = {
- settings: PropTypes.object.isRequired,
- updateBackground: PropTypes.func.isRequired
- }
-
- state = {
- seeds: []
- }
-
- componentDidMount () {
- const { settings } = this.props;
- const seeds = new Array(20).fill(null);
-
- seeds[0] = settings.backgroundSeed;
-
- this.setState({
- seeds
- }, () => this.generateSeeds());
- }
-
- render () {
- return (
-
- }
- >
-
- );
- });
- }
-
- onSelect = (seed) => {
- const { updateBackground } = this.props;
-
- return (event) => {
- updateBackground(seed);
- };
- }
-
- generateSeeds = () => {
- const { seeds } = this.state;
- const current = this.props.settings.backgroundSeed;
-
- const newSeeds = seeds.map((seed) => {
- if (seed === current) {
- return seed;
- }
-
- return this.generateSeed();
- });
-
- this.setState({
- seeds: newSeeds
- });
- }
-
- generateSeed () {
- const { api } = this.context;
-
- return api.util.sha3.text(`${Math.random()}${counter++}`);
- }
-}
-
-function mapStateToProps (state) {
- const { settings } = state;
-
- return { settings };
-}
-
-function mapDispatchToProps (dispatch) {
- return bindActionCreators({ updateBackground }, dispatch);
-}
-
-export default connect(
- mapStateToProps,
- mapDispatchToProps
-)(Background);
diff --git a/js/packages/dapp-settings/Background/index.js b/js/packages/dapp-settings/Background/index.js
deleted file mode 100644
index 43b1ceab0..000000000
--- a/js/packages/dapp-settings/Background/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './background';
diff --git a/js/packages/dapp-settings/Node/index.js b/js/packages/dapp-settings/Node/index.js
deleted file mode 100644
index cc01337ff..000000000
--- a/js/packages/dapp-settings/Node/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './node';
diff --git a/js/packages/dapp-settings/Node/node.js b/js/packages/dapp-settings/Node/node.js
deleted file mode 100644
index 89408de76..000000000
--- a/js/packages/dapp-settings/Node/node.js
+++ /dev/null
@@ -1,250 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { observer } from 'mobx-react';
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-
-import { Container, Dropdown, LanguageSelector } from '@parity/ui';
-import Features, { FeaturesStore, FEATURES } from '@parity/ui/Features';
-
-import Store, { LOGLEVEL_OPTIONS } from './store';
-import layout from '../layout.css';
-
-@observer
-export default class Node extends Component {
- static contextTypes = {
- api: PropTypes.object.isRequired
- };
-
- store = new Store(this.context.api);
- features = FeaturesStore.get();
-
- componentWillMount () {
- this.store.loadChain();
- return this.store.loadMode();
- }
-
- render () {
- return (
-
- }
- >
-
- );
- }
-
- onChangeMode = (event, mode) => {
- this.store.changeMode(mode.name);
- }
-
- onChangeChain = (event, chain) => {
- this.store.changeChain(chain.name);
- }
-}
diff --git a/js/packages/dapp-settings/Node/node.spec.js b/js/packages/dapp-settings/Node/node.spec.js
deleted file mode 100644
index a3bef41a1..000000000
--- a/js/packages/dapp-settings/Node/node.spec.js
+++ /dev/null
@@ -1,117 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { shallow } from 'enzyme';
-import React from 'react';
-import sinon from 'sinon';
-
-import { createApi } from './node.test.js';
-import Node from './';
-
-let component;
-let instance;
-
-function render (props = {}) {
- component = shallow(
- ,
- { context: { api: createApi() } }
- );
- instance = component.instance();
- // console.log(component.debug());
-
- return component;
-}
-
-describe('views/Settings/Node', () => {
- beforeEach(() => {
- render();
- sinon.spy(instance.store, 'loadMode');
- sinon.spy(instance.store, 'loadChain');
- });
-
- afterEach(() => {
- instance.store.loadMode.restore();
- instance.store.loadChain.restore();
- });
-
- it('renders defaults', () => {
- expect(component).to.be.ok;
- });
-
- describe('componentWillMount', () => {
- beforeEach(() => {
- return instance.componentWillMount();
- });
-
- it('loads the mode in the store', () => {
- expect(instance.store.loadMode).to.have.been.called;
- });
-
- it('loads the chain in the store', () => {
- expect(instance.store.loadChain).to.have.been.called;
- });
- });
-
- describe('components', () => {
- it('renders a Container component', () => {
- expect(component.find('Container')).to.have.length(1);
- });
-
- it('renders a LanguageSelector component', () => {
- expect(component.find('LanguageSelector')).to.have.length(1);
- });
-
- it('renders a Features component', () => {
- expect(component.find('LanguageSelector')).to.have.length(1);
- });
- });
-
- describe('Parity features', () => {
- describe('mode selector', () => {
- let select;
-
- beforeEach(() => {
- select = component.find('Dropdown[id="parityModeSelect"]');
- sinon.spy(instance.store, 'changeMode');
- });
-
- afterEach(() => {
- instance.store.changeMode.restore();
- });
-
- it('renders a mode selector', () => {
- expect(select).to.have.length(1);
- });
- });
-
- describe('chain selector', () => {
- let select;
-
- beforeEach(() => {
- select = component.find('Dropdown[id="parityChainSelect"]');
- sinon.spy(instance.store, 'changeChain');
- });
-
- afterEach(() => {
- instance.store.changeChain.restore();
- });
-
- it('renders a chain selector', () => {
- expect(select).to.have.length(1);
- });
- });
- });
-});
diff --git a/js/packages/dapp-settings/Node/node.test.js b/js/packages/dapp-settings/Node/node.test.js
deleted file mode 100644
index 41b337075..000000000
--- a/js/packages/dapp-settings/Node/node.test.js
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import sinon from 'sinon';
-
-function createApi () {
- return {
- parity: {
- mode: sinon.stub().resolves('passive'),
- setMode: sinon.stub().resolves(true),
- chain: sinon.stub().resolves('foundation'),
- setChain: sinon.stub().resolves(true)
- }
- };
-}
-
-export {
- createApi
-};
diff --git a/js/packages/dapp-settings/Node/store.js b/js/packages/dapp-settings/Node/store.js
deleted file mode 100644
index 98e8f228a..000000000
--- a/js/packages/dapp-settings/Node/store.js
+++ /dev/null
@@ -1,135 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import LogLevel from 'loglevel';
-import { action, observable } from 'mobx';
-
-import { LOG_KEYS } from '@parity/shared/config';
-
-const DEFAULT_MODE = 'active';
-const DEFAULT_CHAIN = 'foundation';
-const LOGLEVEL_OPTIONS = Object
- .keys(LogLevel.levels)
- .map((name) => {
- return {
- name,
- value: LogLevel.levels[name]
- };
- });
-
-export default class Store {
- @observable logLevels = {};
- @observable mode = DEFAULT_MODE;
- @observable chain = DEFAULT_CHAIN;
-
- constructor (api) {
- this._api = api;
-
- this.loadLogLevels();
- }
-
- @action setLogLevels = (logLevels) => {
- this.logLevels = { ...logLevels };
- }
-
- @action setLogLevelsSelect = (logLevelsSelect) => {
- this.logLevelsSelect = logLevelsSelect;
- }
-
- @action setMode = (mode) => {
- this.mode = mode;
- }
-
- @action setChain = (chain) => {
- this.chain = chain;
- }
-
- changeMode (mode) {
- return this._api.parity
- .setMode(mode)
- .then((result) => {
- if (result) {
- this.setMode(mode);
- }
- })
- .catch((error) => {
- console.warn('changeMode', error);
- });
- }
-
- changeChain (chain) {
- return this._api.parity
- .setChain(chain)
- .then((result) => {
- if (result) {
- this.setChain(chain);
- }
- })
- .catch((error) => {
- console.warn('changeChain', error);
- });
- }
-
- loadLogLevels () {
- this.setLogLevels(
- Object
- .keys(LOG_KEYS)
- .reduce((state, logKey) => {
- const log = LOG_KEYS[logKey];
- const logger = LogLevel.getLogger(log.key);
- const level = logger.getLevel();
-
- state[logKey] = {
- level,
- log
- };
-
- return state;
- }, this.logLevels)
- );
- }
-
- updateLoggerLevel (key, level) {
- LogLevel.getLogger(key).setLevel(level);
- this.loadLogLevels();
- }
-
- loadMode () {
- return this._api.parity
- .mode()
- .then((mode) => {
- this.setMode(mode);
- })
- .catch((error) => {
- console.warn('loadMode', error);
- });
- }
-
- loadChain () {
- return this._api.parity
- .chain()
- .then((chain) => {
- this.setChain(chain);
- })
- .catch((error) => {
- console.warn('loadChain', error);
- });
- }
-}
-
-export {
- LOGLEVEL_OPTIONS
-};
diff --git a/js/packages/dapp-settings/Node/store.spec.js b/js/packages/dapp-settings/Node/store.spec.js
deleted file mode 100644
index 356430586..000000000
--- a/js/packages/dapp-settings/Node/store.spec.js
+++ /dev/null
@@ -1,125 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import sinon from 'sinon';
-
-import { createApi } from './node.test.js';
-import Store from './store';
-
-let api;
-let store;
-
-function createStore () {
- api = createApi();
- store = new Store(api);
-
- return store;
-}
-
-describe('views/Settings/Parity/Store', () => {
- beforeEach(() => {
- createStore();
- sinon.spy(store, 'setMode');
- sinon.spy(store, 'setChain');
- });
-
- afterEach(() => {
- store.setMode.restore();
- store.setChain.restore();
- });
-
- it('defaults to mode === active', () => {
- expect(store.mode).to.equal('active');
- });
-
- it('defaults to chain === foundation', () => {
- expect(store.chain).to.equal('foundation');
- });
-
- describe('@action', () => {
- describe('setMode', () => {
- it('sets the mode', () => {
- store.setMode('offline');
- expect(store.mode).to.equal('offline');
- });
- });
-
- describe('setChain', () => {
- it('sets the chain', () => {
- store.setChain('dev');
- expect(store.chain).to.equal('dev');
- });
- });
- });
-
- describe('operations', () => {
- describe('changeMode', () => {
- beforeEach(() => {
- return store.changeMode('offline');
- });
-
- it('calls parity.setMode', () => {
- expect(api.parity.setMode).to.have.been.calledWith('offline');
- });
-
- it('sets the mode as provided', () => {
- expect(store.setMode).to.have.been.calledWith('offline');
- });
- });
-
- describe('loadMode', () => {
- beforeEach(() => {
- return store.loadMode();
- });
-
- it('calls parity.mode', () => {
- expect(api.parity.mode).to.have.been.called;
- });
-
- it('sets the mode as retrieved', () => {
- expect(store.setMode).to.have.been.calledWith('passive');
- });
- });
-
- describe('changeChain', () => {
- beforeEach(() => {
- return store.changeChain('dev');
- });
-
- it('calls parity.setChain', () => {
- expect(api.parity.setChain).to.have.been.calledWith('dev');
- });
-
- it('sets the chain as provided', () => {
- expect(store.setChain).to.have.been.calledWith('dev');
- });
- });
-
- describe('loadChain', () => {
- beforeEach(() => {
- return store.loadChain();
- });
-
- it('calls parity.chain', () => {
- expect(api.parity.chain).to.have.been.called;
- });
-
- it('sets the chain as retrieved', () => {
- expect(store.setChain).to.have.been.calledWith('foundation');
- });
- });
- });
-});
diff --git a/js/packages/dapp-settings/Proxy/index.js b/js/packages/dapp-settings/Proxy/index.js
deleted file mode 100644
index 59befe9d1..000000000
--- a/js/packages/dapp-settings/Proxy/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './proxy';
diff --git a/js/packages/dapp-settings/Proxy/proxy.css b/js/packages/dapp-settings/Proxy/proxy.css
deleted file mode 100644
index a1da079c2..000000000
--- a/js/packages/dapp-settings/Proxy/proxy.css
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.details {
- line-height: 1.5em;
-}
-
-.details div+div {
- padding-top: 1.25em;
-}
diff --git a/js/packages/dapp-settings/Proxy/proxy.js b/js/packages/dapp-settings/Proxy/proxy.js
deleted file mode 100644
index 7bb4bb945..000000000
--- a/js/packages/dapp-settings/Proxy/proxy.js
+++ /dev/null
@@ -1,81 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-
-import { Container } from '@parity/ui';
-
-import layout from '../layout.css';
-import styles from './proxy.css';
-
-export default class Proxy extends Component {
- static contextTypes = {
- api: PropTypes.object.isRequired
- }
-
- render () {
- const { dappsUrl } = this.context.api;
- const proxyurl = `${dappsUrl}/proxy/proxy.pac`;
-
- return (
-
- }
- >
-
-
- );
- }
-}
diff --git a/js/packages/dapp-settings/Views/index.js b/js/packages/dapp-settings/Views/index.js
deleted file mode 100644
index 7eb70b150..000000000
--- a/js/packages/dapp-settings/Views/index.js
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import defaultViews from '@parity/shared/config/defaultViews';
-
-export default from './views';
-
-export {
- defaultViews
-};
diff --git a/js/packages/dapp-settings/Views/views.css b/js/packages/dapp-settings/Views/views.css
deleted file mode 100644
index de4079608..000000000
--- a/js/packages/dapp-settings/Views/views.css
+++ /dev/null
@@ -1,55 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.signerIcon {
- width: 24px;
- height: 24px;
- margin-bottom: 5px;
-}
-
-.view {
-}
-
-.view+.view {
- padding-top: 1.5em;
-}
-
-.header {
-}
-
-.labelicon {
- display: inline-block;
- margin-right: 0.75em;
-}
-
-.label {
- display: inline-block;
- vertical-align: top;
- line-height: 24px;
- color: white !important;
-}
-
-.logoIcon {
- height: 24px;
- margin-bottom: 5px;
- opacity: 0.5;
-}
-
-.info {
- color: #aaa;
- padding-left: 4.75em;
-}
diff --git a/js/packages/dapp-settings/Views/views.js b/js/packages/dapp-settings/Views/views.js
deleted file mode 100644
index b6851bf1a..000000000
--- a/js/packages/dapp-settings/Views/views.js
+++ /dev/null
@@ -1,149 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-import { connect } from 'react-redux';
-import { bindActionCreators } from 'redux';
-
-import { toggleView } from '@parity/shared/redux/providers/settings/actions';
-import { Checkbox, Container } from '@parity/ui';
-
-import layout from '../layout.css';
-import styles from './views.css';
-
-class Views extends Component {
- static propTypes = {
- settings: PropTypes.object.isRequired,
- toggleView: PropTypes.func.isRequired,
- availability: PropTypes.string.isRequired
- }
-
- render () {
- return (
-
- }
- >
-
-
- );
- }
-}
-
-function mapStateToProps (state) {
- const { settings } = state;
- const { availability = 'unknown' } = state.nodeStatus.nodeKind || {};
-
- return { settings, availability };
-}
-
-function mapDispatchToProps (dispatch) {
- return bindActionCreators({ toggleView }, dispatch);
-}
-
-export default connect(
- mapStateToProps,
- mapDispatchToProps
-)(Views);
diff --git a/js/packages/dapp-settings/api.js b/js/packages/dapp-settings/api.js
deleted file mode 100644
index b2e52cca0..000000000
--- a/js/packages/dapp-settings/api.js
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import Api from '@parity/api';
-
-const ethereumProvider = window.ethereum || window.parent.ethereum;
-
-if (!ethereumProvider) {
- throw new Error('Unable to locate EthereumProvider, object not attached');
-}
-
-export default new Api(ethereumProvider);
diff --git a/js/packages/dapp-settings/index.js b/js/packages/dapp-settings/index.js
deleted file mode 100644
index e18963142..000000000
--- a/js/packages/dapp-settings/index.js
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import ReactDOM from 'react-dom';
-import React from 'react';
-import { IndexRedirect, Route, Router, hashHistory } from 'react-router';
-
-import injectTapEventPlugin from 'react-tap-event-plugin';
-injectTapEventPlugin();
-
-import { initStore } from '@parity/shared/redux';
-import ContextProvider from '@parity/ui/ContextProvider';
-
-import api from './api';
-
-import SettingsBackground from './Background';
-import SettingsParity from './Node';
-import SettingsProxy from './Proxy';
-import SettingsViews from './Views';
-import Settings from './settings';
-
-const store = initStore(api, hashHistory);
-
-ReactDOM.render(
-
-
-
-
-
-
-
-
-
-
- ,
- document.querySelector('#container')
-);
diff --git a/js/packages/dapp-settings/layout.css b/js/packages/dapp-settings/layout.css
deleted file mode 100644
index 5b105b5a1..000000000
--- a/js/packages/dapp-settings/layout.css
+++ /dev/null
@@ -1,73 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.layout {
- padding-top: 1.5em;
-}
-
-.layout::after {
- display: table;
- clear: both;
- content: '';
-}
-
-.overview, .details {
- float: left;
- box-sizing: border-box;
-}
-
-.overview {
- width: 33.33333%;
- width: -webkit-calc(100% / 12 * 4);
- width: -moz-calc(100% / 12 * 4);
- width: calc(100% / 12 * 4);
-}
-
-.overview {
- opacity: 0.5;
-}
-
-.overview div {
- line-height: 1.5em;
-}
-
-.overview>div+div {
- margin-top: 1.25em;
-}
-
-.details {
- width: 66.66665%;
- width: -webkit-calc(100% / 12 * 8);
- width: -moz-calc(100% / 12 * 8);
- width: calc(100% / 12 * 8);
- padding-left: 3em;
-}
-
-.console {
- font-family: 'Roboto Mono', monospace;
- background: rgba(255, 255, 255, 0.1);
- font-size: 16px;
- padding: 0 0.25em;
-}
-
-.center {
- text-align: center;
-}
-
-.option {
- margin-bottom: 1em;
-}
diff --git a/js/packages/dapp-settings/package.json b/js/packages/dapp-settings/package.json
deleted file mode 100644
index 79019f9df..000000000
--- a/js/packages/dapp-settings/package.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "name": "@parity/dapp-settings",
- "description": "Parity settings view",
- "version": "1.99.99",
- "main": "index.js",
- "author": "Parity Team ",
- "maintainers": [],
- "contributors": [],
- "license": "GPL-3.0",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/paritytech/dapp-settings.git"
- },
- "keywords": [],
- "scripts": {},
- "devDependencies": {},
- "dependencies": {},
- "peerDependencies": {}
-}
diff --git a/js/packages/dapp-settings/settings.css b/js/packages/dapp-settings/settings.css
deleted file mode 100644
index cea3444f7..000000000
--- a/js/packages/dapp-settings/settings.css
+++ /dev/null
@@ -1,65 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.menu {
- display: inline-block;
-}
-
-.bar {
- justify-content: flex-start !important;
-}
-
-.tabs {
- margin-left: 3em;
-}
-
-.tab,
-.tabactive {
- padding: 16px 2em !important;
- line-height: 24px !important;
- width: auto !important;
-
- &>div {
- height: 24px !important;
-
- &>div {
- display: inline-block !important;
- }
- }
-
- svg {
- margin-right: 0.5em;
- margin-bottom: 0 !important;
- }
-
- .menu {
- vertical-align: top;
- display: inline-block;
- }
-}
-
-.imageIcon {
- height: 20px;
- margin: 2px 0.5em 2px 0 !important;
- opacity: 0.5;
-}
-
-.tabactive {
- .imageIcon {
- opacity: 1;
- }
-}
diff --git a/js/packages/dapp-settings/settings.js b/js/packages/dapp-settings/settings.js
deleted file mode 100644
index c40c8e8a4..000000000
--- a/js/packages/dapp-settings/settings.js
+++ /dev/null
@@ -1,81 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-
-import { Page, Tabs } from '@parity/ui';
-import { BackgroundIcon, EthernetIcon, VisibleIcon } from '@parity/ui/Icons';
-
-import imagesEthcoreBlock from '@parity/shared/assets/images/parity-logo-white-no-text.svg';
-
-import styles from './settings.css';
-
-const TABS = ['views', 'background', 'proxy', 'parity'];
-
-export default class Settings extends Component {
- static contextTypes = {
- router: PropTypes.object.isRequired
- }
-
- static propTypes = {
- children: PropTypes.object.isRequired
- }
-
- render () {
- const { children } = this.props;
- const hash = (window.location.hash || '').split('?')[0].split('/')[1];
- const isProxied = window.location.hostname.indexOf('.parity') !== -1;
-
- return (
-
- );
- }
-
- onActivate = (event, tabIndex) => {
- const { router } = this.context;
-
- router.push(`/${TABS[tabIndex]}`);
- }
-}
diff --git a/js/packages/dapp-signaturereg/Application/application.css b/js/packages/dapp-signaturereg/Application/application.css
deleted file mode 100644
index f6f16f124..000000000
--- a/js/packages/dapp-signaturereg/Application/application.css
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.container {
- background: black;
- color: #eee;
- vertical-align: middle;
-}
-
-.actions {
- position: absolute;
- top: 1.5em;
- right: 1.5em;
-}
diff --git a/js/packages/dapp-signaturereg/Application/application.js b/js/packages/dapp-signaturereg/Application/application.js
deleted file mode 100644
index 21e36994e..000000000
--- a/js/packages/dapp-signaturereg/Application/application.js
+++ /dev/null
@@ -1,121 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import BigNumber from 'bignumber.js';
-import React, { Component } from 'react';
-
-import { attachInterface, attachBlockNumber } from '../services';
-import Button from '../Button';
-import Events from '../Events';
-import Header from '../Header';
-import Import from '../Import';
-import Loading from '../Loading';
-
-import styles from './application.css';
-
-export default class Application extends Component {
- state = {
- accounts: {},
- address: null,
- accountsInfo: {},
- blockNumber: new BigNumber(0),
- contract: null,
- instance: null,
- loading: true,
- totalSignatures: new BigNumber(0),
- showImport: false
- }
-
- componentDidMount () {
- return attachInterface()
- .then((state) => {
- this.setState(Object.assign({}, state, { loading: false }));
-
- return attachBlockNumber(state.instance, (state) => {
- this.setState(state);
- });
- })
- .catch((error) => {
- console.error('componentDidMount', error);
- });
- }
-
- render () {
- const { loading } = this.state;
-
- if (loading) {
- return (
-
- );
- }
-
- return (
-
- );
- }
-
- renderEvents () {
- const { accountsInfo, contract } = this.state;
-
- return (
-
- );
- }
-
- toggleImport = () => {
- this.setState({
- showImport: !this.state.showImport
- });
- }
-}
diff --git a/js/packages/dapp-signaturereg/Application/index.js b/js/packages/dapp-signaturereg/Application/index.js
deleted file mode 100644
index 3d8d1ca3b..000000000
--- a/js/packages/dapp-signaturereg/Application/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './application';
diff --git a/js/packages/dapp-signaturereg/Button/button.css b/js/packages/dapp-signaturereg/Button/button.css
deleted file mode 100644
index b4891eaa0..000000000
--- a/js/packages/dapp-signaturereg/Button/button.css
+++ /dev/null
@@ -1,43 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.button {
- background: #f80;
- color: white;
- border-radius: 5px;
- font-size: 1em;
- line-height: 24px;
- height: 24px;
- padding: 0.75em 1.5em;
- cursor: pointer;
- display: inline-block;
-}
-
-.button.disabled {
- opacity: 0.25;
- cursor: default;
-}
-
-.button.inverse {
- color: #f80;
- background: white;
-}
-
-.button * {
- display: inline-block;
- vertical-align: top;
-}
diff --git a/js/packages/dapp-signaturereg/Button/button.js b/js/packages/dapp-signaturereg/Button/button.js
deleted file mode 100644
index aa89d9c1c..000000000
--- a/js/packages/dapp-signaturereg/Button/button.js
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-
-import styles from './button.css';
-
-export default class Button extends Component {
- static propTypes = {
- children: PropTypes.node.isRequired,
- className: PropTypes.string,
- disabled: PropTypes.bool,
- invert: PropTypes.bool,
- onClick: PropTypes.func.isRequired
- }
-
- render () {
- const { children, className, disabled, invert } = this.props;
- const classes = `${styles.button} ${disabled ? styles.disabled : ''} ${invert ? styles.inverse : ''} ${className}`;
-
- return (
-
- { children }
-
- );
- }
-
- onClick = (event) => {
- const { disabled, onClick } = this.props;
-
- if (disabled) {
- return;
- }
-
- onClick(event);
- }
-}
diff --git a/js/packages/dapp-signaturereg/Button/index.js b/js/packages/dapp-signaturereg/Button/index.js
deleted file mode 100644
index 0c2be07ee..000000000
--- a/js/packages/dapp-signaturereg/Button/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './button';
diff --git a/js/packages/dapp-signaturereg/Events/events.css b/js/packages/dapp-signaturereg/Events/events.css
deleted file mode 100644
index 543fdb386..000000000
--- a/js/packages/dapp-signaturereg/Events/events.css
+++ /dev/null
@@ -1,76 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.events {
- padding: 3em;
- text-align: center;
-}
-
-.header {
- font-size: 1.3em;
- line-height: 1.3em;
- vertical-align: middle;
- text-align: center;
- padding-bottom: 24px;
- color: #f80;
-}
-
-.events table {
- border: none;
- margin: 0 auto;
- border-collapse: collapse;
-}
-
-.events td {
- padding: 0 0.5em 0.5em 0.5em;
- white-space: nowrap;
- text-align: left;
- line-height: 24px;
-}
-
-.events td * {
- display: inline-block;
- vertical-align: top;
-}
-
-.pending {
- opacity: 0.5;
-}
-
-.mined {
-}
-
-td.methodName {
- color: #f80;
-}
-
-td.signature {
- color: #888;
- text-align: right;
-}
-
-td.timestamp {
- text-align: right;
-}
-
-td.blockNumber {
- text-align: center;
-}
-
-td.owner {
- text-overflow: ellipsis;
-}
diff --git a/js/packages/dapp-signaturereg/Events/events.js b/js/packages/dapp-signaturereg/Events/events.js
deleted file mode 100644
index 94ca800d0..000000000
--- a/js/packages/dapp-signaturereg/Events/events.js
+++ /dev/null
@@ -1,85 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-
-import { formatBlockNumber, formatBlockTimestamp, formatSignature } from '../format';
-import { attachEvents } from '../services';
-import IdentityIcon from '../IdentityIcon';
-
-import styles from './events.css';
-
-export default class Events extends Component {
- static propTypes = {
- accountsInfo: PropTypes.object.isRequired,
- contract: PropTypes.object.isRequired
- }
-
- state = {
- events: []
- }
-
- componentDidMount () {
- const { contract } = this.props;
-
- attachEvents(contract, (state) => {
- this.setState(state);
- });
- }
-
- render () {
- const { events } = this.state;
-
- if (!events.length) {
- return null;
- }
-
- return (
-
- );
- });
- }
-}
diff --git a/js/packages/dapp-signaturereg/Events/index.js b/js/packages/dapp-signaturereg/Events/index.js
deleted file mode 100644
index d2d0080b3..000000000
--- a/js/packages/dapp-signaturereg/Events/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './events';
diff --git a/js/packages/dapp-signaturereg/Header/header.css b/js/packages/dapp-signaturereg/Header/header.css
deleted file mode 100644
index 8687ad30a..000000000
--- a/js/packages/dapp-signaturereg/Header/header.css
+++ /dev/null
@@ -1,67 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.header {
- position: relative;
- height: 13.69em;
- color: white;
- border-bottom: 4px solid white;
- overflow: hidden;
-}
-
-.banner {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- font-size: 1.3em;
- line-height: 1.3em;
- padding: 24px;
- background: #f80;
-}
-
-.header img,
-.content {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
-}
-
-.header img {
- opacity: 0.2;
- width: 100%;
-}
-
-.content {
- text-align: center;
- padding: 3em;
-}
-
-.hero {
- font-size: 5em;
- line-height: 1.2em;
- vertical-align: middle;
-}
-
-.byline {
- font-size: 1.3em;
- line-height: 1.3em;
- vertical-align: middle;
-}
diff --git a/js/packages/dapp-signaturereg/Header/header.js b/js/packages/dapp-signaturereg/Header/header.js
deleted file mode 100644
index 8ad20d3d2..000000000
--- a/js/packages/dapp-signaturereg/Header/header.js
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-
-import styles from './header.css';
-import blocks from '@parity/shared/assets/images/dapps/blocks-350.jpg';
-
-export default class Header extends Component {
- static propTypes = {
- blockNumber: PropTypes.object.isRequired,
- totalSignatures: PropTypes.object.isRequired
- }
-
- render () {
- const { totalSignatures } = this.props;
-
- return (
-
-
- contract signature registry
-
-
-
-
- { totalSignatures.toFormat(0) }
-
-
- signatures registered
-
-
-
- );
- }
-}
diff --git a/js/packages/dapp-signaturereg/Header/index.js b/js/packages/dapp-signaturereg/Header/index.js
deleted file mode 100644
index 6394066f7..000000000
--- a/js/packages/dapp-signaturereg/Header/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './header.js';
diff --git a/js/packages/dapp-signaturereg/IdentityIcon/identityIcon.css b/js/packages/dapp-signaturereg/IdentityIcon/identityIcon.css
deleted file mode 100644
index 01aba746d..000000000
--- a/js/packages/dapp-signaturereg/IdentityIcon/identityIcon.css
+++ /dev/null
@@ -1,23 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.icon {
- width: 24px;
- height: 24px;
- border-radius: 50%;
- margin-right: 0.5em;
-}
diff --git a/js/packages/dapp-signaturereg/IdentityIcon/identityIcon.js b/js/packages/dapp-signaturereg/IdentityIcon/identityIcon.js
deleted file mode 100644
index 31c3e244e..000000000
--- a/js/packages/dapp-signaturereg/IdentityIcon/identityIcon.js
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-
-import { api } from '../parity';
-import styles from './identityIcon.css';
-
-export default class IdentityIcon extends Component {
- static propTypes = {
- address: PropTypes.string.isRequired
- }
-
- render () {
- const { address } = this.props;
-
- return (
-
- );
- }
-}
diff --git a/js/packages/dapp-signaturereg/IdentityIcon/index.js b/js/packages/dapp-signaturereg/IdentityIcon/index.js
deleted file mode 100644
index 091913564..000000000
--- a/js/packages/dapp-signaturereg/IdentityIcon/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './identityIcon';
diff --git a/js/packages/dapp-signaturereg/Import/import.css b/js/packages/dapp-signaturereg/Import/import.css
deleted file mode 100644
index 2b8946a27..000000000
--- a/js/packages/dapp-signaturereg/Import/import.css
+++ /dev/null
@@ -1,151 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.modal {
- position: fixed;
- top: 0;
- right: 0;
- bottom: 0;
- left: 0;
-}
-
-.overlay {
- position: absolute;
- top: 0;
- right: 0;
- bottom: 0;
- left: 0;
- background: rgba(55, 55, 55, 0.75);
- text-align: center;
-}
-
-.dialog {
- margin-top: 1.5em;
- border-radius: 5px;
- width: 750px;
- background: rgba(0, 0, 0, 0.9);
- display: inline-block;
-}
-
-.close {
- top: 4px;
- right: 4px;
- position: absolute;
- background: transparent;
-}
-
-.header {
- font-size: 1.3em;
- line-height: 1.3em;
- padding: 16px 24px;
- background: #f80;
- color: white;
- position: relative;
- margin-bottom: 24px;
- border-radius: 5px 5px 0 0;
-}
-
-.body {
- padding: 0 24px;
-}
-
-.body div {
- text-align: center;
-}
-
-.info {
- padding: 0 24px 24px 24px;
- line-height: 1.618em;
-}
-
-.info textarea {
- background: rgba(80, 80, 80, 0.25);
- border-radius: 5px;
- resize: none;
- padding: 1em;
- color: #eee;
- font-size: 0.75em;
- font-family: 'Roboto Mono', monospace;
- width: 100%;
- border: none;
- box-sizing: border-box;
-}
-
-.info textarea.error {
- background: rgba(255, 0, 0, 0.25);
-}
-
-.info .error {
- color: rgba(255, 0, 0, 1);
- font-size: 0.75em;
- line-height: 1.5em;
-}
-
-.buttonrow {
- position: relative;
- padding: 24px 0;
- margin: 0;
- text-align: right !important;
-}
-
-.addressSelect {
- position: absolute;
- top: 24px;
- left: 0;
-}
-
-.keys {
- position: absolute;
- left: 24px;
- top: 16px;
- padding: 4px 0;
-}
-
-.fnconstant,
-.fnexists,
-.fnunknown,
-.fntodo {
- display: inline-block;
- margin: 0.25em;
- padding: 0.5em 1em;
- border-radius: 2px;
- color: white;
- line-height: 1em;
- font-size: 0.8em;
-}
-
-.fnconstant {
- color: #888;
- background: #333;
-}
-
-.fnexists {
- color: #f80;
- background: #333;
-}
-
-.fnunknown {
- color: #eee;
-}
-
-.fntodo {
- background: #f80;
-}
-
-.hide {
- opacity: 0;
-}
diff --git a/js/packages/dapp-signaturereg/Import/import.js b/js/packages/dapp-signaturereg/Import/import.js
deleted file mode 100644
index cac85599e..000000000
--- a/js/packages/dapp-signaturereg/Import/import.js
+++ /dev/null
@@ -1,205 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-
-import { api } from '../parity';
-import { callRegister, postRegister } from '../services';
-import Button from '../Button';
-
-import styles from './import.css';
-
-export default class Import extends Component {
- static propTypes = {
- instance: PropTypes.object.isRequired,
- visible: PropTypes.bool.isRequired,
- onClose: PropTypes.func.isRequired
- }
-
- state = {
- abi: null,
- abiParsed: null,
- abiError: 'Please add a valid ABI definition',
- functions: null,
- fnstate: {}
- }
-
- render () {
- const { visible, onClose } = this.props;
- const { abiError } = this.state;
-
- if (!visible) {
- return null;
- }
-
- return (
-
- Provide the ABI (Contract Interface) in the space provided below. Only non-constant functions (names & types) will be imported, while constant functions and existing signatures will be ignored.
-
- );
- });
- }
-
- sortFunctions = (a, b) => {
- return (a.name || '').localeCompare(b.name || '');
- }
-
- countFunctions () {
- const { functions, fnstate } = this.state;
-
- if (!functions) {
- return 0;
- }
-
- return functions.filter((fn) => fnstate[fn.signature] === 'fntodo').length;
- }
-
- testFunction (fn) {
- const { instance } = this.props;
- const { fnstate } = this.state;
-
- callRegister(instance, fn.id)
- .then((result) => {
- fnstate[fn.signature] = result ? 'fntodo' : 'fnexists';
- this.setState(fnstate);
- })
- .catch((error) => {
- console.error(error);
- });
- }
-
- onAbiEdit = (event) => {
- let functions = null;
- let abiError = null;
- let abiParsed = null;
- let abi = null;
-
- try {
- abiParsed = JSON.parse(event.target.value);
- functions = api.newContract(abiParsed).functions.sort(this.sortFunctions);
- abi = JSON.stringify(abiParsed);
- } catch (error) {
- console.error('onAbiEdit', error);
- abiError = error.message;
- }
-
- this.setState({
- functions,
- abiError,
- abiParsed,
- abi
- });
- }
-
- onRegister = () => {
- const { instance, onClose } = this.props;
- const { functions, fnstate } = this.state;
-
- return Promise
- .all(
- functions
- .filter((fn) => !fn.constant)
- .filter((fn) => fnstate[fn.signature] === 'fntodo')
- .map((fn) => postRegister(instance, fn.id, {}))
- )
- .then(() => {
- onClose();
- })
- .catch((error) => {
- console.error('onRegister', error);
- });
- }
-}
diff --git a/js/packages/dapp-signaturereg/Import/index.js b/js/packages/dapp-signaturereg/Import/index.js
deleted file mode 100644
index 52deb93f0..000000000
--- a/js/packages/dapp-signaturereg/Import/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './import';
diff --git a/js/packages/dapp-signaturereg/Loading/index.js b/js/packages/dapp-signaturereg/Loading/index.js
deleted file mode 100644
index 5eb10a7d4..000000000
--- a/js/packages/dapp-signaturereg/Loading/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './loading';
diff --git a/js/packages/dapp-signaturereg/Loading/loading.css b/js/packages/dapp-signaturereg/Loading/loading.css
deleted file mode 100644
index 36d792c7d..000000000
--- a/js/packages/dapp-signaturereg/Loading/loading.css
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.loading {
- width: 100%;
- text-align: center;
- padding-top: 5em;
- font-size: 2em;
- color: #999;
-}
diff --git a/js/packages/dapp-signaturereg/Loading/loading.js b/js/packages/dapp-signaturereg/Loading/loading.js
deleted file mode 100644
index f716214d2..000000000
--- a/js/packages/dapp-signaturereg/Loading/loading.js
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-
-import styles from './loading.css';
-
-export default class Loading extends Component {
- render () {
- return (
-
- Attaching to contract ...
-
- );
- }
-}
diff --git a/js/packages/dapp-signaturereg/format.js b/js/packages/dapp-signaturereg/format.js
deleted file mode 100644
index 1b766d317..000000000
--- a/js/packages/dapp-signaturereg/format.js
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import BigNumber from 'bignumber.js';
-import moment from 'moment';
-
-import { api } from './parity';
-
-const ZERO = new BigNumber(0);
-
-export function formatBlockNumber (blockNumber) {
- return ZERO.eq(blockNumber || 0)
- ? 'Pending'
- : `${blockNumber.toFormat()}`;
-}
-
-export function formatSignature (signature) {
- return api.util.bytesToHex(signature);
-}
-
-export function formatBlockTimestamp (block) {
- if (!block || !block.timestamp) {
- return null;
- }
-
- return moment(block.timestamp).fromNow();
-}
diff --git a/js/packages/dapp-signaturereg/index.js b/js/packages/dapp-signaturereg/index.js
deleted file mode 100644
index de98cb636..000000000
--- a/js/packages/dapp-signaturereg/index.js
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import ReactDOM from 'react-dom';
-import React from 'react';
-import { AppContainer } from 'react-hot-loader';
-
-import injectTapEventPlugin from 'react-tap-event-plugin';
-injectTapEventPlugin();
-
-import Application from './Application';
-
-import '@parity/shared/assets/fonts/Roboto/font.css';
-import '@parity/shared/assets/fonts/RobotoMono/font.css';
-import '@parity/dapps/style.css';
-
-ReactDOM.render(
-
-
- ,
- document.querySelector('#container')
-);
-
-if (module.hot) {
- module.hot.accept('./Application/index.js', () => {
- require('./Application/index.js');
-
- ReactDOM.render(
-
-
- ,
- document.querySelector('#container')
- );
- });
-}
diff --git a/js/packages/dapp-signaturereg/package.json b/js/packages/dapp-signaturereg/package.json
deleted file mode 100644
index 1e952cd8a..000000000
--- a/js/packages/dapp-signaturereg/package.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "name": "@parity/dapp-signaturereg",
- "description": "Parity dapps",
- "version": "1.99.99",
- "main": "index.js",
- "author": "Parity Team ",
- "maintainers": [],
- "contributors": [],
- "license": "GPL-3.0",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/paritytech/dapp-signaturereg.git"
- },
- "keywords": [],
- "scripts": {},
- "devDependencies": {},
- "dependencies": {
- },
- "peerDependencies": {}
-}
diff --git a/js/packages/dapp-signaturereg/parity.js b/js/packages/dapp-signaturereg/parity.js
deleted file mode 100644
index 742386288..000000000
--- a/js/packages/dapp-signaturereg/parity.js
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import Api from '@parity/api';
-
-const ethereumProvider = window.ethereum || window.parent.ethereum;
-
-if (!ethereumProvider) {
- throw new Error('Unable to locate EthereumProvider, object not attached');
-}
-
-const api = new Api(ethereumProvider);
-
-export {
- api
-};
diff --git a/js/packages/dapp-signaturereg/services.js b/js/packages/dapp-signaturereg/services.js
deleted file mode 100644
index 86a3bd81a..000000000
--- a/js/packages/dapp-signaturereg/services.js
+++ /dev/null
@@ -1,182 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import * as abis from '@parity/shared/contracts/abi';
-
-import { api } from './parity';
-
-const sortEvents = (a, b) => b.blockNumber.cmp(a.blockNumber) || b.logIndex.cmp(a.logIndex);
-
-const logToEvent = (log) => {
- const key = api.util.sha3(JSON.stringify(log));
- const { blockNumber, logIndex, transactionHash, transactionIndex, params, type } = log;
-
- return {
- type: log.event,
- state: type,
- blockNumber,
- logIndex,
- transactionHash,
- transactionIndex,
- params: Object.keys(params).reduce((data, name) => {
- data[name] = params[name].value;
- return data;
- }, {}),
- key
- };
-};
-
-export function attachInterface (callback) {
- return api.parity
- .registryAddress()
- .then((registryAddress) => {
- console.log(`the registry was found at ${registryAddress}`);
-
- const registry = api.newContract(abis.registry, registryAddress).instance;
-
- return Promise
- .all([
- registry.getAddress.call({}, [api.util.sha3('signaturereg'), 'A']),
- api.parity.accountsInfo()
- ]);
- })
- .then(([address, accountsInfo]) => {
- console.log(`signaturereg was found at ${address}`);
-
- const contract = api.newContract(abis.signaturereg, address);
- const accounts = Object
- .keys(accountsInfo)
- .reduce((obj, address) => {
- const info = accountsInfo[address] || {};
-
- return Object.assign(obj, {
- [address]: {
- address,
- name: info.name || 'Unnamed'
- }
- });
- }, {});
- const fromAddress = Object.keys(accounts)[0];
-
- return {
- accounts,
- address,
- accountsInfo,
- contract,
- instance: contract.instance,
- fromAddress
- };
- })
- .catch((error) => {
- console.error('attachInterface', error);
- });
-}
-
-export function attachBlockNumber (instance, callback) {
- return api.subscribe('eth_blockNumber', (error, blockNumber) => {
- if (error) {
- console.error('blockNumber', error);
- return;
- }
-
- instance.totalSignatures
- .call()
- .then((totalSignatures) => {
- callback({
- blockNumber,
- totalSignatures
- });
- })
- .catch((error) => {
- console.error('totalSignatures', error);
- });
- });
-}
-
-export function attachEvents (contract, callback) {
- const blocks = { '0': {} };
- let mined = [];
- let pending = [];
- let events = [];
-
- const options = {
- fromBlock: 0,
- toBlock: 'pending',
- limit: 50
- };
-
- return contract.subscribe('Registered', options, (error, _logs) => {
- if (error) {
- console.error('events', error);
- return;
- }
-
- const logs = _logs.map(logToEvent);
-
- mined = logs
- .filter((log) => log.state === 'mined')
- .map((log) => {
- const blockNumber = log.blockNumber.toString();
-
- if (!blocks[blockNumber]) {
- blocks[blockNumber] = {};
- getBlock(blockNumber).then((block) => {
- Object.assign(blocks[blockNumber], block);
- });
- }
-
- return Object.assign(log, { block: blocks[blockNumber] });
- })
- .reverse()
- .concat(mined)
- .sort(sortEvents);
-
- pending = logs
- .filter((log) => log.state === 'pending')
- .reverse()
- .filter((event) => !pending.find((log) => log.params.method === event.params.method))
- .concat(pending)
- .filter((event) => !mined.find((log) => log.params.method === event.params.method))
- .sort(sortEvents);
-
- events = pending.concat(mined);
-
- callback({ events });
- });
-}
-
-export function getBlock (blockNumber) {
- return api.parity.getBlockHeaderByNumber(blockNumber);
-}
-
-export function callRegister (instance, id, options = {}) {
- return instance.register.call(options, [id]);
-}
-
-export function postRegister (instance, id, options = {}) {
- return api.parity
- .defaultAccount()
- .then((defaultAddress) => {
- options.from = defaultAddress;
-
- return instance.register.estimateGas(options, [id]);
- })
- .then((gas) => {
- options.gas = gas.mul(1.2).toFixed(0);
- console.log('postRegister', `gas estimated at ${gas.toFormat(0)}, setting to ${gas.mul(1.2).toFormat(0)}`);
- instance.register.postTransaction(options, [id]);
- });
-}
diff --git a/js/packages/dapp-signer/RequestsPage/index.js b/js/packages/dapp-signer/RequestsPage/index.js
deleted file mode 100644
index 6bb7d69c5..000000000
--- a/js/packages/dapp-signer/RequestsPage/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './requestsPage';
diff --git a/js/packages/dapp-signer/RequestsPage/requestsPage.css b/js/packages/dapp-signer/RequestsPage/requestsPage.css
deleted file mode 100644
index 151c6a24c..000000000
--- a/js/packages/dapp-signer/RequestsPage/requestsPage.css
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.noRequestsMsg {
- color: #aaa;
-}
-
-.request {
- &:nth-child(odd) {
- background: rgba(255, 255, 255, 0.04);
- }
-}
diff --git a/js/packages/dapp-signer/RequestsPage/requestsPage.js b/js/packages/dapp-signer/RequestsPage/requestsPage.js
deleted file mode 100644
index fc571b4c8..000000000
--- a/js/packages/dapp-signer/RequestsPage/requestsPage.js
+++ /dev/null
@@ -1,180 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import BigNumber from 'bignumber.js';
-import { observer } from 'mobx-react';
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-import { connect } from 'react-redux';
-import { bindActionCreators } from 'redux';
-
-import { newError } from '@parity/shared/redux/actions';
-import { startConfirmRequest, startRejectRequest } from '@parity/shared/redux/providers/signerActions';
-import { Container, Page, TxList } from '@parity/ui';
-
-// FIXME: We should not be importing from shell!
-import Store from '~/src/Signer/store';
-import RequestPending from '~/src/Signer/components/RequestPending';
-
-import styles from './requestsPage.css';
-
-@observer
-class RequestsPage extends Component {
- static contextTypes = {
- api: PropTypes.object.isRequired
- };
-
- static propTypes = {
- gasLimit: PropTypes.object.isRequired,
- netVersion: PropTypes.string.isRequired,
- startConfirmRequest: PropTypes.func.isRequired,
- startRejectRequest: PropTypes.func.isRequired,
-
- blockNumber: PropTypes.object,
- newError: PropTypes.func,
- signer: PropTypes.shape({
- pending: PropTypes.array.isRequired,
- finished: PropTypes.array.isRequired
- }).isRequired
- };
-
- store = new Store(this.context.api, true);
-
- componentWillUnmount () {
- this.store.unsubscribe();
- }
-
- render () {
- return (
-
-
-
- );
- }
-
- const items = pending.sort(this._sortRequests).map(this.renderPending);
-
- return (
-
- }
- >
- { items }
-
- );
- }
-
- renderPending = (data, index) => {
- const { startConfirmRequest, startRejectRequest, gasLimit, netVersion } = this.props;
- const { date, id, isSending, payload, origin } = data;
-
- return (
-
- );
- }
-}
-
-function mapStateToProps (state) {
- const { gasLimit, netVersion, blockNumber } = state.nodeStatus;
- const { signer } = state;
-
- return {
- blockNumber,
- gasLimit,
- netVersion,
- signer
- };
-}
-
-function mapDispatchToProps (dispatch) {
- return bindActionCreators({
- newError,
- startConfirmRequest,
- startRejectRequest
- }, dispatch);
-}
-
-export default connect(
- mapStateToProps,
- mapDispatchToProps
-)(RequestsPage);
diff --git a/js/packages/dapp-signer/api.js b/js/packages/dapp-signer/api.js
deleted file mode 100644
index b2e52cca0..000000000
--- a/js/packages/dapp-signer/api.js
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import Api from '@parity/api';
-
-const ethereumProvider = window.ethereum || window.parent.ethereum;
-
-if (!ethereumProvider) {
- throw new Error('Unable to locate EthereumProvider, object not attached');
-}
-
-export default new Api(ethereumProvider);
diff --git a/js/packages/dapp-signer/index.js b/js/packages/dapp-signer/index.js
deleted file mode 100644
index 519d790a0..000000000
--- a/js/packages/dapp-signer/index.js
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import ReactDOM from 'react-dom';
-import React from 'react';
-import { Route, Router, hashHistory } from 'react-router';
-
-import injectTapEventPlugin from 'react-tap-event-plugin';
-injectTapEventPlugin();
-
-import ContractInstances from '@parity/shared/contracts';
-import { initStore } from '@parity/shared/redux';
-import ContextProvider from '@parity/ui/ContextProvider';
-
-import api from './api';
-
-import Signer from './signer';
-
-ContractInstances.get(api);
-
-const store = initStore(api, hashHistory);
-
-ReactDOM.render(
-
-
-
-
- ,
- document.querySelector('#container')
-);
diff --git a/js/packages/dapp-signer/package.json b/js/packages/dapp-signer/package.json
deleted file mode 100644
index a538b3935..000000000
--- a/js/packages/dapp-signer/package.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "name": "@parity/dapp-signer",
- "description": "Parity signer views, embedded and requests",
- "version": "1.99.99",
- "main": "index.js",
- "author": "Parity Team ",
- "maintainers": [],
- "contributors": [],
- "license": "GPL-3.0",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/paritytech/dapp-signer.git"
- },
- "keywords": [],
- "scripts": {},
- "devDependencies": {},
- "dependencies": {},
- "peerDependencies": {}
-}
diff --git a/js/packages/dapp-signer/signer.js b/js/packages/dapp-signer/signer.js
deleted file mode 100644
index 34acfc469..000000000
--- a/js/packages/dapp-signer/signer.js
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React from 'react';
-import { FormattedMessage } from 'react-intl';
-
-import { Actionbar } from '@parity/ui';
-
-import RequestsPage from './RequestsPage';
-
-export default function Signer () {
- return (
-
-
- }
- />
-
-
- );
-}
diff --git a/js/packages/dapp-status/Debug/Logs/index.js b/js/packages/dapp-status/Debug/Logs/index.js
deleted file mode 100644
index 25cb05328..000000000
--- a/js/packages/dapp-status/Debug/Logs/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './logs';
diff --git a/js/packages/dapp-status/Debug/Logs/logs.js b/js/packages/dapp-status/Debug/Logs/logs.js
deleted file mode 100644
index 42ba0b1d0..000000000
--- a/js/packages/dapp-status/Debug/Logs/logs.js
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React from 'react';
-
-import { arrayOrObjectProptype } from '@parity/shared/util/proptypes';
-
-import styles from '../debug.css';
-
-export default function Logs ({ logs }) {
- if (!logs || logs.length === 0) {
- return null;
- }
-
- return (
-
- {
- logs.map((log, index) => {
- return (
-
- [{ log.date.toLocaleString() }]
- { log.log }
-
- );
- })
- }
-
- );
-}
-
-Logs.propTypes = {
- logs: arrayOrObjectProptype()
-};
diff --git a/js/packages/dapp-status/Debug/Toggle/index.js b/js/packages/dapp-status/Debug/Toggle/index.js
deleted file mode 100644
index 3941ab2b3..000000000
--- a/js/packages/dapp-status/Debug/Toggle/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './toggle';
diff --git a/js/packages/dapp-status/Debug/Toggle/toggle.js b/js/packages/dapp-status/Debug/Toggle/toggle.js
deleted file mode 100644
index 35ae4acd4..000000000
--- a/js/packages/dapp-status/Debug/Toggle/toggle.js
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-
-import styles from '../debug.css';
-
-export default function Toggle ({ logsEnabled }) {
- if (logsEnabled) {
- return null;
- }
-
- return (
-
-
-
- );
-}
-
-Toggle.propTypes = {
- logsEnabled: PropTypes.bool
-};
diff --git a/js/packages/dapp-status/Debug/debug.css b/js/packages/dapp-status/Debug/debug.css
deleted file mode 100644
index 70e929a59..000000000
--- a/js/packages/dapp-status/Debug/debug.css
+++ /dev/null
@@ -1,82 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-.subheader {
- margin-top: 0;
-}
-
-.inputTrigger {
- display: none;
- left: 310px;
- bottom: 4px;
- position: absolute;
- cursor: pointer;
- animation: fadein .3s;
-}
-
-*:hover > .inputTrigger {
- display: block;
-}
-
-@keyframes fadein {
- 0% { opacity: 0; }
- 100% { opacity: 1; }
-}
-
-.logs {
- margin: 0;
- max-width: 100%;
-}
-
-.log {
- font-family: monospace;
- font-size: 0.9em;
- white-space: pre-line;
- word-wrap: break-word;
- color: #aaa;
- margin: 0.5em 0;
- display: flex;
- align-items: center;
-}
-
-.logDate {
- color: green;
- font-size: 0.85em;
- margin-right: 0.5em;
-}
-
-.logText {
- flex: 1;
-}
-
-.stopped {
- color: #aaa;
- padding: 1em 0;
-}
-
-.container {
- width: 100%;
-}
-
-.actions {
- float: right;
-}
-
-.actions a {
- margin-left: 5px;
- cursor: pointer;
- color: #bbb;
-}
diff --git a/js/packages/dapp-status/Debug/debug.js b/js/packages/dapp-status/Debug/debug.js
deleted file mode 100644
index 7c36de670..000000000
--- a/js/packages/dapp-status/Debug/debug.js
+++ /dev/null
@@ -1,97 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { observer } from 'mobx-react';
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-
-import { Container } from '@parity/ui';
-import { PauseIcon, PlayIcon, ReorderIcon, ReplayIcon } from '@parity/ui/Icons';
-
-import Logs from './Logs';
-import Toggle from './Toggle';
-import DebugStore from './store';
-import styles from './debug.css';
-
-@observer
-export default class Debug extends Component {
- static contextTypes = {
- api: PropTypes.object.isRequired
- };
-
- debugStore = new DebugStore(this.context.api);
-
- componentWillUnmount () {
- this.debugStore.stopPolling();
- }
-
- render () {
- const { logs, logsEnabled, logsLevels } = this.debugStore;
-
- return (
-
- }
- >
-
-
-
-
- );
- }
-
- clear = () => {
- this.debugStore.clearLogs();
- };
-
- toggle = () => {
- this.debugStore.toggle();
- };
-
- reverse = () => {
- this.debugStore.reverse();
- };
-}
diff --git a/js/packages/dapp-status/Debug/index.js b/js/packages/dapp-status/Debug/index.js
deleted file mode 100644
index 539b7e0fb..000000000
--- a/js/packages/dapp-status/Debug/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './debug';
diff --git a/js/packages/dapp-status/Debug/store.js b/js/packages/dapp-status/Debug/store.js
deleted file mode 100644
index 22466b7f9..000000000
--- a/js/packages/dapp-status/Debug/store.js
+++ /dev/null
@@ -1,128 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { action, observable, transaction } from 'mobx';
-
-const LOG_DATE_REGEX = /^(\d{4}.\d{2}.\d{2}.\d{2}.\d{2}.\d{2})(.*)$/i;
-const MAX_LOGS = 25;
-
-export default class DebugStore {
- @observable logs = [];
- @observable logsLevels = null;
- @observable logsEnabled = false;
- @observable reversed = false;
-
- api = null;
- _lastLogAdded = null;
- _timeoutId = null;
-
- constructor (api) {
- this.api = api;
- }
-
- @action clearLogs () {
- this.logs = [];
- }
-
- @action setLogs (logs, logsLevels) {
- let newLogs = [];
-
- if (this._lastLogAdded) {
- const sliceIndex = logs.findIndex((log) => log === this._lastLogAdded);
-
- newLogs = logs.slice(0, sliceIndex);
- } else {
- newLogs = logs.slice();
- }
-
- this._lastLogAdded = logs[0];
-
- const parsedLogs = newLogs
- .map((log) => {
- const logDate = LOG_DATE_REGEX.exec(log);
-
- if (!logDate) {
- return null;
- }
-
- return {
- date: new Date(logDate[1]),
- log: logDate[2]
- };
- })
- .filter((log) => log);
-
- transaction(() => {
- if (!this.reversed) {
- this.logs = [].concat(parsedLogs, this.logs.slice()).slice(0, MAX_LOGS);
- } else {
- parsedLogs.reverse();
- this.logs = [].concat(this.logs.slice(), parsedLogs).slice(-1 * MAX_LOGS);
- }
-
- this.logsLevels = logsLevels;
- });
- }
-
- @action toggle () {
- this.logsEnabled = !this.logsEnabled;
-
- if (this.logsEnabled) {
- this.initPolling();
- } else {
- this.stopPolling();
- }
- }
-
- @action reverse () {
- transaction(() => {
- this.reversed = !this.reversed;
- this.logs = this.logs.reverse();
- });
- }
-
- initPolling () {
- this._pollLogs();
- }
-
- stopPolling () {
- if (this._timeoutId) {
- clearTimeout(this._timeoutId);
- }
- }
-
- _pollLogs = () => {
- const nextTimeout = (timeout = 1000) => {
- this.stopPolling();
- this._timeoutId = setTimeout(this._pollLogs, timeout);
- };
-
- return Promise
- .all([
- this.api.parity.devLogs(),
- this.api.parity.devLogsLevels()
- ])
- .then(([ devLogs, devLogsLevels ]) => {
- this.setLogs(devLogs, devLogsLevels);
- })
- .catch((error) => {
- console.error('_pollLogs', error);
- })
- .then(() => {
- return nextTimeout();
- });
- }
-}
diff --git a/js/packages/dapp-status/Health/health.js b/js/packages/dapp-status/Health/health.js
deleted file mode 100644
index f4190b99c..000000000
--- a/js/packages/dapp-status/Health/health.js
+++ /dev/null
@@ -1,153 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-import { connect } from 'react-redux';
-
-import { Container, ContainerTitle, StatusIndicator } from '@parity/ui';
-
-import grid from '../Node/node.css';
-
-const HealthItem = (props) => {
- const status = props.item.status || 'needsAttention';
-
- return (
-
-
- );
- }
-}
-
-function mapStateToProps (state) {
- return state.nodeStatus.health;
-}
-
-export default connect(
- mapStateToProps,
- null
-)(Health);
diff --git a/js/packages/dapp-status/Health/index.js b/js/packages/dapp-status/Health/index.js
deleted file mode 100644
index 3fefcb039..000000000
--- a/js/packages/dapp-status/Health/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './health';
diff --git a/js/packages/dapp-status/MiningSettings/decodeExtraData.js b/js/packages/dapp-status/MiningSettings/decodeExtraData.js
deleted file mode 100644
index 36cf1691d..000000000
--- a/js/packages/dapp-status/MiningSettings/decodeExtraData.js
+++ /dev/null
@@ -1,34 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import rlp from 'rlp';
-
-export function decodeExtraData (str) {
- try {
- // Try decoding as RLP
- const decoded = rlp.decode(str);
- const v = decoded[0];
-
- decoded[0] = decoded[1];
- decoded[1] = `${v[0]}.${v[1]}.${v[2]}`;
- return decoded.join('/');
- } catch (err) {
- // hex -> str
- return str.match(/.{1,2}/g).map(v => {
- return String.fromCharCode(parseInt(v, 16));
- }).join('');
- }
-}
diff --git a/js/packages/dapp-status/MiningSettings/decodeExtraData.spec.js b/js/packages/dapp-status/MiningSettings/decodeExtraData.spec.js
deleted file mode 100644
index 093e409ba..000000000
--- a/js/packages/dapp-status/MiningSettings/decodeExtraData.spec.js
+++ /dev/null
@@ -1,28 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { decodeExtraData } from './decodeExtraData';
-
-describe('views/Status/components/MiningSettings/decodeExtraData', () => {
- describe('EXTRA DATA', () => {
- const str = 'parity/1.0.0/1.0.0-beta2';
- const encoded = '0xd783010000867061726974798b312e302e302d6265746132';
-
- it('should decode encoded to str', () => {
- expect(decodeExtraData(encoded)).to.equal(str);
- });
- });
-});
diff --git a/js/packages/dapp-status/MiningSettings/index.js b/js/packages/dapp-status/MiningSettings/index.js
deleted file mode 100644
index e443ce3e7..000000000
--- a/js/packages/dapp-status/MiningSettings/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './miningSettings';
diff --git a/js/packages/dapp-status/MiningSettings/miningSettings.js b/js/packages/dapp-status/MiningSettings/miningSettings.js
deleted file mode 100644
index 0cb17e594..000000000
--- a/js/packages/dapp-status/MiningSettings/miningSettings.js
+++ /dev/null
@@ -1,175 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import formatNumber from 'format-number';
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-
-import { ContainerTitle, Input, TypedInput } from '@parity/ui';
-
-import { numberFromString } from './numberFromString';
-import { decodeExtraData } from './decodeExtraData';
-
-const toNiceNumber = formatNumber();
-
-export default class MiningSettings extends Component {
- static contextTypes = {
- api: PropTypes.object
- };
-
- static propTypes = {
- coinbase: PropTypes.string,
- defaultExtraData: PropTypes.string,
- extraData: PropTypes.string,
- gasFloorTarget: PropTypes.object,
- minGasPrice: PropTypes.object,
- onUpdateSetting: PropTypes.func.isRequired
- };
-
- render () {
- const { coinbase, defaultExtraData, extraData, gasFloorTarget, minGasPrice } = this.props;
- const decodedExtraData = extraData
- ? decodeExtraData(extraData)
- : '';
- const decodedDefaultExtraData = defaultExtraData
- ? decodeExtraData(defaultExtraData)
- : '';
-
- return (
-
- );
- }
-
- onMinGasPriceChange = (newVal) => {
- const { api } = this.context;
-
- api.parity
- .setMinGasPrice(numberFromString(newVal))
- .then(() => this.updateMiningSettings());
- };
-
- onExtraDataChange = (value) => {
- const { api } = this.context;
-
- api.parity
- .setExtraData(value)
- .then(() => this.updateMiningSettings());
- };
-
- onAuthorChange = (newVal) => {
- const { api } = this.context;
-
- api.parity
- .setAuthor(newVal)
- .then(() => this.updateMiningSettings());
- };
-
- onGasFloorTargetChange = (newVal) => {
- const { api } = this.context;
-
- api.parity
- .setGasFloorTarget(numberFromString(newVal))
- .then(() => this.updateMiningSettings());
- };
-
- updateMiningSettings () {
- this.props.onUpdateSetting();
- }
-}
diff --git a/js/packages/dapp-status/MiningSettings/numberFromString.js b/js/packages/dapp-status/MiningSettings/numberFromString.js
deleted file mode 100644
index d9f0b3da1..000000000
--- a/js/packages/dapp-status/MiningSettings/numberFromString.js
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export function numberFromString (val) {
- return parseInt(
- val
- .replace(/m/ig, 'k')
- .replace(/k/ig, '000')
- .replace(/[^0-9]/g, '')
- , 10
- );
-}
diff --git a/js/packages/dapp-status/MiningSettings/numberFromString.spec.js b/js/packages/dapp-status/MiningSettings/numberFromString.spec.js
deleted file mode 100644
index 64c1ac24f..000000000
--- a/js/packages/dapp-status/MiningSettings/numberFromString.spec.js
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { numberFromString } from './numberFromString';
-
-describe('views/Status/components/MiningSettings/numberFromString', () => {
- it('should convert string to number', () => {
- expect(numberFromString('12345'), 12345);
- });
-
- it('should handle special characters "k" and "m"', () => {
- expect(numberFromString('10kk'), 10000000);
- expect(numberFromString('10K'), 1000);
- expect(numberFromString('10Mmk'), 1000000000000000);
- });
-
- it('should ignore any non-numeric characters', () => {
- expect(numberFromString('10.000.000'), 10000000);
- expect(numberFromString('10_000_000'), 10000000);
- expect(numberFromString('10_k_k'), 10000000);
- expect(numberFromString('-5'), 5);
- });
-});
diff --git a/js/packages/dapp-status/Node/index.js b/js/packages/dapp-status/Node/index.js
deleted file mode 100644
index cc01337ff..000000000
--- a/js/packages/dapp-status/Node/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './node';
diff --git a/js/packages/dapp-status/Node/node.css b/js/packages/dapp-status/Node/node.css
deleted file mode 100644
index 0c00e5b18..000000000
--- a/js/packages/dapp-status/Node/node.css
+++ /dev/null
@@ -1,84 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.container {
- padding-bottom: 1em;
-}
-
-.row {
- margin: 0 -1em;
-
- &::after {
- display: table;
- clear: both;
- content: '';
- }
-}
-
-.blockInfo {
- color: #aaa;
- font-size: 1.5em;
- line-height: 1.5em;
-}
-
-.blockByline {
- color: #aaa;
- font-size: 0.75em;
-}
-
-.padBottom {
- padding-bottom: 1.25em !important;
-}
-
-.col,
-.col3, .col4, .col4_5, .col6, .col12 {
- float: left;
- padding: 0 1em;
- box-sizing: border-box;
-}
-
-.col3 {
- width: 25%;
- width: -webkit-calc(100% / 12 * 3);
- width: -moz-calc(100% / 12 * 3);
- width: calc(100% / 12 * 3);
-}
-
-.col4 {
- width: 33.3%;
- width: -webkit-calc(100% / 12 * 4);
- width: -moz-calc(100% / 12 * 4);
- width: calc(100% / 12 * 4);
-}
-
-.col4_5 {
- width: 37.5%;
- width: -webkit-calc(100% / 12 * 4.5);
- width: -moz-calc(100% / 12 * 4.5);
- width: calc(100% / 12 * 4.5);
-}
-
-.col6 {
- width: 50%;
- width: -webkit-calc(100% / 12 * 6);
- width: -moz-calc(100% / 12 * 6);
- width: calc(100% / 12 * 6);
-}
-
-.col12 {
- width: 100%;
-}
diff --git a/js/packages/dapp-status/Node/node.js b/js/packages/dapp-status/Node/node.js
deleted file mode 100644
index 67d3550af..000000000
--- a/js/packages/dapp-status/Node/node.js
+++ /dev/null
@@ -1,258 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import bytes from 'bytes';
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-import { observer } from 'mobx-react';
-
-import { BlockNumber, BlockTimestamp, Container, ContainerTitle, Input, NetPeers } from '@parity/ui';
-
-import MiningSettings from '../MiningSettings';
-import StatusStore from './store';
-
-import styles from './node.css';
-
-@observer
-export default class Node extends Component {
- static contextTypes = {
- api: PropTypes.object.isRequired
- };
-
- statusStore = new StatusStore(this.context.api);
-
- render () {
- const { hashrate } = this.statusStore;
- const hashrateValue = bytes(hashrate.toNumber()) || 0;
-
- return (
-
-
- );
- }
-}
diff --git a/js/packages/dapp-status/Node/store.js b/js/packages/dapp-status/Node/store.js
deleted file mode 100644
index 44d6a5fd9..000000000
--- a/js/packages/dapp-status/Node/store.js
+++ /dev/null
@@ -1,171 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import BigNumber from 'bignumber.js';
-import { action, computed, observable, transaction } from 'mobx';
-
-import { NetChain } from '@parity/ui';
-
-console.log('NetChain', NetChain, NetChain.Store);
-
-export default class StatusStore {
- @observable defaultExtraData = '';
- @observable enode = '';
- @observable hashrate = new BigNumber(0);
- @observable netPort = new BigNumber(0);
- @observable nodeName = '';
- @observable rpcSettings = {};
-
- @observable coinbase = '';
- @observable extraData = '';
- @observable gasFloorTarget = new BigNumber(0);
- @observable minGasPrice = new BigNumber(0);
-
- api = null;
- _timeoutIds = {};
-
- constructor (api) {
- this.api = api;
- this.chainStore = NetChain.Store.get(api);
-
- this.startPolling();
- }
-
- @computed get netChain () {
- return this.chainStore.netChain;
- }
-
- @action setLongStatus ({ defaultExtraData, enode, netPort, rpcSettings }) {
- transaction(() => {
- this.defaultExtraData = defaultExtraData;
- this.enode = enode;
- this.netPort = netPort;
- this.rpcSettings = rpcSettings;
- });
- }
-
- @action setStatus ({ hashrate }) {
- transaction(() => {
- this.hashrate = hashrate;
- });
- }
-
- @action setMinerSettings ({ coinbase, extraData, gasFloorTarget, minGasPrice }) {
- transaction(() => {
- this.coinbase = coinbase;
- this.extraData = extraData;
- this.gasFloorTarget = gasFloorTarget;
- this.minGasPrice = minGasPrice;
- });
- }
-
- startPolling () {
- this._pollStatus();
- this._pollLongStatus();
- }
-
- stopPolling () {
- Object.keys(this._timeoutIds).forEach((key) => clearTimeout(this._timeoutIds[key]));
- }
-
- /**
- * Miner settings should never changes unless
- * Parity is restarted, or if the values are changed
- * from the UI
- */
- _pollMinerSettings () {
- return Promise
- .all([
- this.api.eth.coinbase(),
- this.api.parity.extraData(),
- this.api.parity.gasFloorTarget(),
- this.api.parity.minGasPrice()
- ])
- .then(([
- coinbase, extraData, gasFloorTarget, minGasPrice
- ]) => {
- const minerSettings = {
- coinbase,
- extraData,
- gasFloorTarget,
- minGasPrice
- };
-
- this.setMinerSettings(minerSettings);
- })
- .catch((error) => {
- console.error('_pollMinerSettings', error);
- });
- }
-
- _pollStatus () {
- const nextTimeout = (timeout = 1000) => {
- clearTimeout(this._timeoutIds.short);
- this._timeoutIds.short = setTimeout(() => this._pollStatus(), timeout);
- };
-
- return Promise
- .all([
- this.api.eth.hashrate()
- ])
- .then(([
- hashrate
- ]) => {
- this.setStatus({
- hashrate
- });
- })
- .catch((error) => {
- console.error('_pollStatus', error);
- })
- .then(() => {
- nextTimeout();
- });
- }
-
- _pollLongStatus () {
- const nextTimeout = (timeout = 30000) => {
- clearTimeout(this._timeoutIds.long);
- this._timeoutIds.long = setTimeout(() => this._pollLongStatus(), timeout);
- };
-
- this._pollMinerSettings();
- return Promise
- .all([
- this.api.parity.defaultExtraData(),
- this.api.parity.enode().then((enode) => enode).catch(() => '-'),
- this.api.parity.netPort(),
- this.api.parity.rpcSettings()
- ])
- .then(([
- defaultExtraData, enode, netPort, rpcSettings
- ]) => {
- this.setLongStatus({
- defaultExtraData, enode, netPort, rpcSettings
- });
- })
- .catch((error) => {
- console.error('_pollLongStatus', error);
- })
- .then(() => {
- nextTimeout();
- });
- }
-
- handleUpdateSetting = () => {
- return this._pollMinerSettings();
- };
-}
diff --git a/js/packages/dapp-status/Peers/Peer/index.js b/js/packages/dapp-status/Peers/Peer/index.js
deleted file mode 100644
index 66fe3ded4..000000000
--- a/js/packages/dapp-status/Peers/Peer/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './peer';
diff --git a/js/packages/dapp-status/Peers/Peer/peer.js b/js/packages/dapp-status/Peers/Peer/peer.js
deleted file mode 100644
index 497cdb7c5..000000000
--- a/js/packages/dapp-status/Peers/Peer/peer.js
+++ /dev/null
@@ -1,72 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React from 'react';
-import PropTypes from 'prop-types';
-
-import { ScrollableText, ShortenedHash } from '@parity/ui';
-
-import styles from '../peers.css';
-
-export default function Peer ({ index, peer }) {
- const { caps, id, name, network, protocols } = peer;
-
- return (
-
- );
-}
-
-Peer.propTypes = {
- peer: PropTypes.object,
- index: PropTypes.number
-};
diff --git a/js/packages/dapp-status/Peers/index.js b/js/packages/dapp-status/Peers/index.js
deleted file mode 100644
index a223af63c..000000000
--- a/js/packages/dapp-status/Peers/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './peers';
diff --git a/js/packages/dapp-status/Peers/peers.css b/js/packages/dapp-status/Peers/peers.css
deleted file mode 100644
index a164aea81..000000000
--- a/js/packages/dapp-status/Peers/peers.css
+++ /dev/null
@@ -1,60 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.peers {
- margin-top: 0.5em;
- overflow: auto;
- width: 100%;
-
- table {
- border-collapse: collapse;
- width: 100%;
- }
-
- th {
- padding: 0.5em;
- text-align: left;
- white-space: nowrap;
- }
-}
-
-.peer {
- &:nth-child(odd) {
- background-color: rgba(200, 200, 200, 0.1);
- }
-
- td {
- border-top: 1px solid #333;
- font-size: 0.9em;
- overflow: hidden;
- padding: 0.5em 0.25em;
- white-space: nowrap;
- }
-}
-
-.form {
- align-items: center;
- display: flex;
- flex-direction: row;
- float: right;
- width: 40em;
-
- .input {
- flex: 1;
- margin-right: 1em;
- }
-}
diff --git a/js/packages/dapp-status/Peers/peers.js b/js/packages/dapp-status/Peers/peers.js
deleted file mode 100644
index 03552d4a6..000000000
--- a/js/packages/dapp-status/Peers/peers.js
+++ /dev/null
@@ -1,365 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-import { bindActionCreators } from 'redux';
-import { connect } from 'react-redux';
-
-import { showSnackbar } from '@parity/shared/redux/providers/snackbarActions';
-import { newError } from '@parity/shared/redux/actions';
-import { Button, Container, ContainerTitle, Input, ScrollableText, ShortenedHash } from '@parity/ui';
-
-import styles from './peers.css';
-
-class Peers extends Component {
- static contextTypes = {
- api: PropTypes.object
- };
-
- static propTypes = {
- peers: PropTypes.array.isRequired,
- newError: PropTypes.func,
- showSnackbar: PropTypes.func
- };
-
- state = {
- action: '',
- formInput: '',
- showForm: false
- };
-
- getActions () {
- return [
-
- }
- onClick={ this.handleAcceptNonReserved }
- />,
-
- }
- onClick={ this.handleDropNonReserved }
- />,
-
- }
- onClick={ this.handleAddReserved }
- />,
-
- }
- onClick={ this.handleRemoveReserved }
- />
- ];
- }
-
- render () {
- const { peers } = this.props;
-
- return (
-
-
- }
- />
- { this.renderForm() }
-
- );
- }
-
- handleAcceptNonReserved = () => {
- return this.context.api.parity.acceptNonReservedPeers()
- .then(() => {
- const message = (
-
- );
-
- this.props.showSnackbar(message, 3000);
- })
- .catch((error) => {
- this.props.newError(error);
- });
- };
-
- handleDropNonReserved = () => {
- return this.context.api.parity.dropNonReservedPeers()
- .then(() => {
- const message = (
-
- );
-
- this.props.showSnackbar(message, 3000);
- })
- .catch((error) => {
- this.props.newError(error);
- });
- };
-
- handleAddReserved = () => {
- this.setState({ showForm: true, action: 'add' });
- };
-
- handleRemoveReserved = () => {
- this.setState({ showForm: true, action: 'remove' });
- };
-
- handleInputChange = (event, value) => {
- this.setState({ formInput: value });
- };
-
- handleCancelForm = () => {
- this.setState({ showForm: false, action: '', formInput: '' });
- };
-
- handleConfirmForm = () => {
- const { action, formInput } = this.state;
- let method;
-
- if (action === 'add') {
- method = 'addReservedPeer';
- } else if (action === 'remove') {
- method = 'removeReservedPeer';
- }
-
- this.setState({ showForm: false, action: '', formInput: '' });
-
- if (!method) {
- return;
- }
-
- this.context.api.parity[method](formInput)
- .then(() => {
- const message = (
-
- );
-
- this.props.showSnackbar(message, 3000);
- })
- .catch((error) => {
- this.props.newError(error);
- });
- };
-}
-
-function mapStateToProps (state) {
- const handshakeRegex = /handshake/i;
-
- const { netPeers } = state.nodeStatus;
- const { peers = [] } = netPeers;
- const realPeers = peers
- .filter((peer) => peer.id)
- .filter((peer) => !handshakeRegex.test(peer.network.remoteAddress))
- .filter((peer) => peer.protocols.eth && peer.protocols.eth.head)
- .sort((peerA, peerB) => {
- const idComp = peerA.id.localeCompare(peerB.id);
-
- return idComp;
- });
-
- return { peers: realPeers };
-}
-
-function mapDispatchToProps (dispatch) {
- return bindActionCreators({
- newError,
- showSnackbar
- }, dispatch);
-}
-
-export default connect(mapStateToProps, mapDispatchToProps)(Peers);
diff --git a/js/packages/dapp-status/api.js b/js/packages/dapp-status/api.js
deleted file mode 100644
index b2e52cca0..000000000
--- a/js/packages/dapp-status/api.js
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import Api from '@parity/api';
-
-const ethereumProvider = window.ethereum || window.parent.ethereum;
-
-if (!ethereumProvider) {
- throw new Error('Unable to locate EthereumProvider, object not attached');
-}
-
-export default new Api(ethereumProvider);
diff --git a/js/packages/dapp-status/index.js b/js/packages/dapp-status/index.js
deleted file mode 100644
index f1792fcde..000000000
--- a/js/packages/dapp-status/index.js
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import ReactDOM from 'react-dom';
-import React from 'react';
-import { Route, Router, hashHistory } from 'react-router';
-
-import injectTapEventPlugin from 'react-tap-event-plugin';
-injectTapEventPlugin();
-
-import ContractInstances from '@parity/shared/contracts';
-import { initStore } from '@parity/shared/redux';
-import ContextProvider from '@parity/ui/ContextProvider';
-
-import api from './api';
-import Status from './status';
-
-ContractInstances.get(api);
-
-const store = initStore(api, hashHistory);
-
-ReactDOM.render(
-
-
-
-
- ,
- document.querySelector('#container')
-);
diff --git a/js/packages/dapp-status/package.json b/js/packages/dapp-status/package.json
deleted file mode 100644
index 43f43ef63..000000000
--- a/js/packages/dapp-status/package.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "name": "@parity/dapp-status",
- "description": "Parity default Status view",
- "version": "1.99.99",
- "main": "index.js",
- "author": "Parity Team ",
- "maintainers": [],
- "contributors": [],
- "license": "GPL-3.0",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/paritytech/dapp-status.git"
- },
- "keywords": [],
- "scripts": {},
- "devDependencies": {},
- "dependencies": {},
- "peerDependencies": {}
-}
diff --git a/js/packages/dapp-status/status.css b/js/packages/dapp-status/status.css
deleted file mode 100644
index d6d5a07f5..000000000
--- a/js/packages/dapp-status/status.css
+++ /dev/null
@@ -1,22 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.body {
- &>div {
- margin-bottom: 0.25em;
- }
-}
diff --git a/js/packages/dapp-status/status.js b/js/packages/dapp-status/status.js
deleted file mode 100644
index 8c3b001f7..000000000
--- a/js/packages/dapp-status/status.js
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React from 'react';
-import { FormattedMessage } from 'react-intl';
-
-import { Page } from '@parity/ui';
-
-import Debug from './Debug';
-import Health from './Health';
-import Node from './Node';
-import Peers from './Peers';
-
-import styles from './status.css';
-
-console.log('Node', Node);
-
-export default function Status () {
- return (
-
- }
- >
-
-
-
-
-
-
-
- );
-}
diff --git a/js/packages/dapp-tokendeploy/AddressSelect/addressSelect.css b/js/packages/dapp-tokendeploy/AddressSelect/addressSelect.css
deleted file mode 100644
index b4b88684a..000000000
--- a/js/packages/dapp-tokendeploy/AddressSelect/addressSelect.css
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.iconMenu {
-}
-
-.iconMenu option {
- padding-left: 30px;
-}
-
-.menu {
- display: none;
-}
diff --git a/js/packages/dapp-tokendeploy/AddressSelect/addressSelect.js b/js/packages/dapp-tokendeploy/AddressSelect/addressSelect.js
deleted file mode 100644
index 29b48f1f6..000000000
--- a/js/packages/dapp-tokendeploy/AddressSelect/addressSelect.js
+++ /dev/null
@@ -1,96 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-
-import { api } from '../parity';
-import styles from './addressSelect.css';
-
-export default class AddressSelect extends Component {
- static contextTypes = {
- accounts: PropTypes.object.isRequired
- }
-
- static propTypes = {
- addresses: PropTypes.array.isRequired,
- onChange: PropTypes.func.isRequired
- }
-
- state = {
- selected: null
- }
-
- componentDidMount () {
- const { addresses } = this.props;
-
- this.onChange({
- target: {
- value: addresses[0]
- }
- });
- }
-
- componentWillReceiveProps (newProps) {
- const { addresses } = this.props;
- let changed = addresses.length !== newProps.addresses.length;
-
- if (!changed) {
- changed = addresses.filter((address, index) => newProps.addresses[index] !== address).length;
- }
-
- if (changed) {
- this.onChange({ target: { value: newProps.addresses[0] } });
- }
- }
-
- render () {
- const { addresses } = this.props;
- const { selectedAddress } = this.state;
- const style = {
- background: `rgba(255, 255, 255, 0.75) url(${api.util.createIdentityImg(selectedAddress, 3)}) no-repeat 98% center`
- };
-
- return (
-
- );
- }
-
- renderOption = (address) => {
- const { accounts } = this.context;
- const account = accounts[address];
-
- return (
-
- );
- }
-
- onChange = (event) => {
- this.setState({ selectedAddress: event.target.value });
- this.props.onChange(event);
- }
-}
diff --git a/js/packages/dapp-tokendeploy/AddressSelect/index.js b/js/packages/dapp-tokendeploy/AddressSelect/index.js
deleted file mode 100644
index 9ae382b93..000000000
--- a/js/packages/dapp-tokendeploy/AddressSelect/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './addressSelect';
diff --git a/js/packages/dapp-tokendeploy/Application/Header/header.css b/js/packages/dapp-tokendeploy/Application/Header/header.css
deleted file mode 100644
index fb149db96..000000000
--- a/js/packages/dapp-tokendeploy/Application/Header/header.css
+++ /dev/null
@@ -1,71 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.header {
-}
-
-.titlebar {
- padding: 0.5em 1em;
- margin: 0;
- color: white;
-}
-
-.navigation {
- table-layout: fixed;
- width: 100%;
- border-spacing: 0.25em;
- border-collapse: separate;
- border-color: white;
- background: white;
-}
-
-.navigation tr {
- height: 10em;
-}
-
-.title {
- font-size: 1.25em;
- margin-bottom: 0.25em;
-}
-
-.byline {
- font-size: 1em;
- opacity: 0.75;
- margin-bottom: 0.25em;
-}
-
-.description {
- font-size: 0.5em;
- opacity: 0.5;
- line-height: 1.5em;
-}
-
-.navNext,
-.navCurrent {
- color: white;
- padding: 1em 2em;
- vertical-align: middle;
-}
-
-.navNext:hover {
- cursor: pointer;
- opacity: 0.8;
-}
-
-.navCurrent {
- font-size: 2em;
-}
diff --git a/js/packages/dapp-tokendeploy/Application/Header/header.js b/js/packages/dapp-tokendeploy/Application/Header/header.js
deleted file mode 100644
index 5096c7b9e..000000000
--- a/js/packages/dapp-tokendeploy/Application/Header/header.js
+++ /dev/null
@@ -1,82 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-
-import PAGES from '../pages';
-import styles from './header.css';
-
-export default class Header extends Component {
- static contextTypes = {
- router: PropTypes.object.isRequired
- }
-
- render () {
- const path = (window.location.hash || '').split('?')[0].split('/')[1];
- const offset = PAGES.findIndex((header) => header.path === path);
-
- return (
-
- );
- }
-
- onNavigate = (route) => {
- const { router } = this.context;
-
- return (event) => {
- router.push(`/${route}`);
- };
- }
-}
diff --git a/js/packages/dapp-tokendeploy/Application/Header/index.js b/js/packages/dapp-tokendeploy/Application/Header/index.js
deleted file mode 100644
index aef90266f..000000000
--- a/js/packages/dapp-tokendeploy/Application/Header/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './header';
diff --git a/js/packages/dapp-tokendeploy/Application/Loading/index.js b/js/packages/dapp-tokendeploy/Application/Loading/index.js
deleted file mode 100644
index 5eb10a7d4..000000000
--- a/js/packages/dapp-tokendeploy/Application/Loading/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './loading';
diff --git a/js/packages/dapp-tokendeploy/Application/Loading/loading.css b/js/packages/dapp-tokendeploy/Application/Loading/loading.css
deleted file mode 100644
index 2c305c729..000000000
--- a/js/packages/dapp-tokendeploy/Application/Loading/loading.css
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.body {
- width: 100%;
- text-align: center;
- padding-top: 5em;
- font-size: 2em;
- color: #999;
-}
diff --git a/js/packages/dapp-tokendeploy/Application/Loading/loading.js b/js/packages/dapp-tokendeploy/Application/Loading/loading.js
deleted file mode 100644
index 2ac4ffb0d..000000000
--- a/js/packages/dapp-tokendeploy/Application/Loading/loading.js
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-
-import styles from './loading.css';
-
-export default class Loading extends Component {
- render () {
- return (
-
- Attaching to contract ...
-
- );
- }
-}
diff --git a/js/packages/dapp-tokendeploy/Application/application.css b/js/packages/dapp-tokendeploy/Application/application.css
deleted file mode 100644
index 173f654f6..000000000
--- a/js/packages/dapp-tokendeploy/Application/application.css
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.container {
- color: #444;
- vertical-align: middle;
- min-height: 100vh;
- position:relative;
-}
-
-.body {
- padding: 0 0.25em;
-}
diff --git a/js/packages/dapp-tokendeploy/Application/application.js b/js/packages/dapp-tokendeploy/Application/application.js
deleted file mode 100644
index 76069aff0..000000000
--- a/js/packages/dapp-tokendeploy/Application/application.js
+++ /dev/null
@@ -1,108 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-
-import { api } from '../parity';
-import { attachInstances } from '../services';
-
-import Header from './Header';
-import Loading from './Loading';
-
-import styles from './application.css';
-
-export default class Application extends Component {
- static childContextTypes = {
- accounts: PropTypes.object,
- managerInstance: PropTypes.object,
- registryInstance: PropTypes.object,
- tokenregInstance: PropTypes.object
- }
-
- static propTypes = {
- children: PropTypes.node.isRequired
- }
-
- state = {
- accounts: null,
- loading: true,
- managerInstance: null,
- registryInstance: null,
- tokenregInstance: null
- }
-
- componentDidMount () {
- return this.attachInstance();
- }
-
- render () {
- const { children } = this.props;
- const { loading } = this.state;
-
- if (loading) {
- return (
-
- );
- }
-
- return (
-
-
-
- { children }
-
-
- );
- }
-
- getChildContext () {
- const { accounts, managerInstance, registryInstance, tokenregInstance } = this.state;
-
- return {
- accounts,
- managerInstance,
- registryInstance,
- tokenregInstance
- };
- }
-
- attachInstance () {
- return Promise
- .all([
- api.parity.accountsInfo(),
- attachInstances()
- ])
- .then(([accountsInfo, { managerInstance, registryInstance, tokenregInstance }]) => {
- accountsInfo = accountsInfo || {};
- this.setState({
- loading: false,
- managerInstance,
- registryInstance,
- tokenregInstance,
- accounts: Object
- .keys(accountsInfo)
- .sort((a, b) => {
- return (accountsInfo[b].name || '').localeCompare(accountsInfo[a].name || '');
- })
- .reduce((accounts, address) => {
- accounts[address] = Object.assign(accountsInfo[address], { address });
- return accounts;
- }, {})
- });
- });
- }
-}
diff --git a/js/packages/dapp-tokendeploy/Application/index.js b/js/packages/dapp-tokendeploy/Application/index.js
deleted file mode 100644
index 3d8d1ca3b..000000000
--- a/js/packages/dapp-tokendeploy/Application/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './application';
diff --git a/js/packages/dapp-tokendeploy/Application/pages.js b/js/packages/dapp-tokendeploy/Application/pages.js
deleted file mode 100644
index 2839cb4d1..000000000
--- a/js/packages/dapp-tokendeploy/Application/pages.js
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-const PAGES = [
- {
- path: 'overview',
- title: 'Overview',
- byline: 'Display all the current information relating to your own deployed tokens',
- description: 'View the total number of tokens in circulation, the number of different tokens associated with your accounts, as well as the types of tokens created by you. In addition, view the balances associated with your accounts in relation to the total in circulation.'
- },
- {
- path: 'transfer',
- title: 'Transfer',
- byline: 'Send tokens associated with your accounts to other addresses',
- description: 'Send any tokens created by you or received from others. In addition, have a bird\'s eye view of all events relating to token transfers, be it yours, created by others, either local or globally available on the network.'
- },
- {
- path: 'deploy',
- title: 'Deploy',
- byline: 'Deploy a new token to the network',
- description: 'Token registration has never been this easy. Select the name for your token, the TLA and the number of tokens in circulation. Start sending the tokens to contacts right from this interface. Optionally you can register the token with the Token Registry which would allow you to transact in tokens from anywhere these transactions are allowed.'
- }
-];
-
-export default PAGES;
diff --git a/js/packages/dapp-tokendeploy/Container/container.css b/js/packages/dapp-tokendeploy/Container/container.css
deleted file mode 100644
index b42ef522c..000000000
--- a/js/packages/dapp-tokendeploy/Container/container.css
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.content {
- padding: 4em;
- margin-bottom: 0.25em;
- text-align: center;
-}
-
-.content:nth-child(odd) {
- background: rgba(102, 34, 34, 0.075);
-}
diff --git a/js/packages/dapp-tokendeploy/Container/container.js b/js/packages/dapp-tokendeploy/Container/container.js
deleted file mode 100644
index 7851c02b1..000000000
--- a/js/packages/dapp-tokendeploy/Container/container.js
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-
-import styles from './container.css';
-
-export default class Container extends Component {
- static propTypes = {
- className: PropTypes.string,
- children: PropTypes.node.isRequired
- }
-
- render () {
- const { className, children } = this.props;
- const classes = `${styles.content} ${className}`;
-
- return (
-
- { children }
-
- );
- }
-}
diff --git a/js/packages/dapp-tokendeploy/Container/index.js b/js/packages/dapp-tokendeploy/Container/index.js
deleted file mode 100644
index 0deedaecc..000000000
--- a/js/packages/dapp-tokendeploy/Container/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './container';
diff --git a/js/packages/dapp-tokendeploy/Deploy/Deployment/deployment.css b/js/packages/dapp-tokendeploy/Deploy/Deployment/deployment.css
deleted file mode 100644
index 1403a3df1..000000000
--- a/js/packages/dapp-tokendeploy/Deploy/Deployment/deployment.css
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-@import '../../_form.css';
-@import '../../_status.css';
diff --git a/js/packages/dapp-tokendeploy/Deploy/Deployment/deployment.js b/js/packages/dapp-tokendeploy/Deploy/Deployment/deployment.js
deleted file mode 100644
index 244ba6360..000000000
--- a/js/packages/dapp-tokendeploy/Deploy/Deployment/deployment.js
+++ /dev/null
@@ -1,322 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-
-import { api } from '../../parity';
-import Container from '../../Container';
-import styles from './deployment.css';
-
-const DECIMALS = 6;
-const BASE = Math.pow(10, DECIMALS);
-
-const ERRORS = {
- name: 'specify a valid name >2 & <32 characters',
- tla: 'specify a valid TLA, 3 characters in length',
- usedtla: 'the TLA used is not available for registration',
- supply: `supply needs to be > 1 & <1 trillion, with no more than ${DECIMALS} decimals`
-};
-
-export default class Deployment extends Component {
- static contextTypes = {
- accounts: PropTypes.object.isRequired,
- router: PropTypes.object.isRequired,
- managerInstance: PropTypes.object.isRequired,
- registryInstance: PropTypes.object.isRequired,
- tokenregInstance: PropTypes.object.isRequired
- };
-
- static initState = {
- base: null,
- deployBusy: false,
- deployDone: false,
- deployError: null,
- deployState: null,
- globalReg: false,
- globalFee: 0,
- globalFeeText: '1.000',
- fromAddress: null,
- name: '',
- nameError: ERRORS.name,
- tla: '',
- tlaError: ERRORS.tla,
- totalSupply: '5000000',
- totalSupplyError: null,
- signerRequestId: null,
- txHash: null
- };
-
- state = Deployment.initState
-
- componentDidMount () {
- const { managerInstance, tokenregInstance } = this.context;
-
- Promise
- .all([
- managerInstance.base.call(),
- tokenregInstance.fee.call()
- ])
- .then(([base, globalFee]) => {
- this.setState({
- base,
- baseText: base.toFormat(0),
- globalFee,
- globalFeeText: api.util.fromWei(globalFee).toFormat(3)
- });
- });
- }
-
- reset () {
- this.setState(Deployment.initState, () => this.componentDidMount());
- }
-
- render () {
- const { deployBusy } = this.state;
-
- return deployBusy
- ? this.renderDeploying()
- : this.renderForm();
- }
-
- renderDeploying () {
- const { deployDone, deployError, deployState } = this.state;
-
- if (deployDone) {
- return (
-
-
- Your token has been deployed
-
-
- );
- }
-
- if (deployError) {
- return (
-
-
- Your deployment has encountered an error
-
-
- { deployError.message }
-
-
- );
- }
-
- return (
-
-
- Your token is currently being deployed to the network
-
- );
- }
-
- renderHash (hash) {
- return `${hash.substr(0, 10)}...${hash.slice(-10)}`;
- }
-
- lookup () {
- const { event } = this.props;
-
- if (event.type === 'pending') {
- return;
- }
-
- Promise
- .all([
- api.parity.getBlockHeaderByNumber(event.blockNumber),
- getCoin(event.params.tokenreg, event.params.coin)
- ])
- .then(([block, coin]) => {
- this.setState({ block, coin });
- });
- }
-}
diff --git a/js/packages/dapp-tokendeploy/Deploy/Event/index.js b/js/packages/dapp-tokendeploy/Deploy/Event/index.js
deleted file mode 100644
index 25441954b..000000000
--- a/js/packages/dapp-tokendeploy/Deploy/Event/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './event';
diff --git a/js/packages/dapp-tokendeploy/Deploy/Events/events.css b/js/packages/dapp-tokendeploy/Deploy/Events/events.css
deleted file mode 100644
index 48c107e0a..000000000
--- a/js/packages/dapp-tokendeploy/Deploy/Events/events.css
+++ /dev/null
@@ -1,41 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.statusHeader {
- font-size: 1.25em;
-}
-
-.eventList {
- border: none;
- margin: 0 auto;
- border-collapse: collapse;
- display: flex;
- overflow: auto;
-
- > * {
- display: flex;
- flex: 1;
- flex-direction: column;
- }
-}
-
-.eventList tr:nth-child(even) {
- background: rgba(102, 34, 34, 0.075);
-}
-
-.eventList tr:nth-child(odd) {
-}
diff --git a/js/packages/dapp-tokendeploy/Deploy/Events/events.js b/js/packages/dapp-tokendeploy/Deploy/Events/events.js
deleted file mode 100644
index 32aa601c8..000000000
--- a/js/packages/dapp-tokendeploy/Deploy/Events/events.js
+++ /dev/null
@@ -1,146 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-
-import { api } from '../../parity';
-import Container from '../../Container';
-import Event from '../Event';
-
-import styles from './events.css';
-
-export default class Events extends Component {
- static contextTypes = {
- managerInstance: PropTypes.object.isRequired
- }
-
- state = {
- blocks: {},
- loading: true,
- events: [],
- minedEvents: [],
- pendingEvents: []
- }
-
- componentDidMount () {
- const { managerInstance } = this.context;
- const options = {
- fromBlock: 0,
- toBlock: 'pending',
- limit: 50
- };
-
- managerInstance.Created
- .subscribe(options, this.receiveCreatedEvents)
- .then((subscriptionIdCreated) => {
- this.setState({ subscriptionIdCreated });
- });
- }
-
- componentWillUnmount () {
- const { managerInstance } = this.context;
- const { subscriptionIdCreated } = this.state;
-
- managerInstance.Created.unsubscribe(subscriptionIdCreated);
- }
-
- render () {
- const { loading } = this.state;
-
- return (
-
- { loading ? this.renderLoading() : this.renderEvents() }
-
- );
- }
-
- renderEvents () {
- const { events } = this.state;
-
- return events.length
- ? this.renderEventsList()
- : this.renderEventsNone();
- }
-
- renderEventsNone () {
- return (
-
- );
- }
-
- logToEvent = (log) => {
- log.key = api.util.sha3(JSON.stringify(log));
- log.params = Object.keys(log.params).reduce((params, name) => {
- params[name] = log.params[name].value;
- return params;
- }, {});
-
- return log;
- }
-
- receiveCreatedEvents = (error, logs) => {
- if (error) {
- console.error('receiveLogs', error);
- return;
- }
-
- const { minedEvents, pendingEvents } = this.state;
- const minedNew = logs
- .filter((log) => log.type === 'mined')
- .map(this.logToEvent)
- .filter((log) => !minedEvents.find((event) => event.transactionHash === log.transactionHash))
- .reverse()
- .concat(minedEvents);
- const pendingNew = logs
- .filter((log) => log.type === 'pending')
- .map(this.logToEvent)
- .filter((log) => !pendingEvents.find((event) => event.transactionHash === log.transactionHash))
- .reverse()
- .concat(pendingEvents)
- .filter((log) => !minedNew.find((event) => event.transactionHash === log.transactionHash));
- const events = [].concat(pendingNew).concat(minedNew);
-
- this.setState({ loading: false, events, minedEvents: minedNew, pendingEvents: pendingNew });
- }
-}
diff --git a/js/packages/dapp-tokendeploy/Deploy/Events/index.js b/js/packages/dapp-tokendeploy/Deploy/Events/index.js
deleted file mode 100644
index d2d0080b3..000000000
--- a/js/packages/dapp-tokendeploy/Deploy/Events/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './events';
diff --git a/js/packages/dapp-tokendeploy/Deploy/deploy.js b/js/packages/dapp-tokendeploy/Deploy/deploy.js
deleted file mode 100644
index c83f4bf93..000000000
--- a/js/packages/dapp-tokendeploy/Deploy/deploy.js
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-
-import Deployment from './Deployment';
-import Events from './Events';
-
-export default class Deploy extends Component {
- render () {
- return (
-
-
-
-
- );
- }
-}
diff --git a/js/packages/dapp-tokendeploy/Deploy/index.js b/js/packages/dapp-tokendeploy/Deploy/index.js
deleted file mode 100644
index 3b7668834..000000000
--- a/js/packages/dapp-tokendeploy/Deploy/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './deploy';
diff --git a/js/packages/dapp-tokendeploy/IdentityIcon/identityIcon.css b/js/packages/dapp-tokendeploy/IdentityIcon/identityIcon.css
deleted file mode 100644
index 1edc36a4a..000000000
--- a/js/packages/dapp-tokendeploy/IdentityIcon/identityIcon.css
+++ /dev/null
@@ -1,22 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.icon {
- width: 24px;
- height: 24px;
- margin: 0 0.5em -4px 0;
-}
diff --git a/js/packages/dapp-tokendeploy/IdentityIcon/identityIcon.js b/js/packages/dapp-tokendeploy/IdentityIcon/identityIcon.js
deleted file mode 100644
index 91ee02e57..000000000
--- a/js/packages/dapp-tokendeploy/IdentityIcon/identityIcon.js
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-
-import { api } from '../parity';
-import styles from './identityIcon.css';
-
-export default class IdentityIcon extends Component {
- static propTypes = {
- address: PropTypes.string.isRequired,
- className: PropTypes.string
- }
-
- render () {
- const { address, className } = this.props;
- const classes = `${styles.icon} ${className}`;
-
- return (
-
- );
- }
-}
diff --git a/js/packages/dapp-tokendeploy/IdentityIcon/index.js b/js/packages/dapp-tokendeploy/IdentityIcon/index.js
deleted file mode 100644
index 091913564..000000000
--- a/js/packages/dapp-tokendeploy/IdentityIcon/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './identityIcon';
diff --git a/js/packages/dapp-tokendeploy/Overview/Owner/index.js b/js/packages/dapp-tokendeploy/Overview/Owner/index.js
deleted file mode 100644
index 19a28e266..000000000
--- a/js/packages/dapp-tokendeploy/Overview/Owner/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './owner';
diff --git a/js/packages/dapp-tokendeploy/Overview/Owner/owner.css b/js/packages/dapp-tokendeploy/Overview/Owner/owner.css
deleted file mode 100644
index 06211ca9e..000000000
--- a/js/packages/dapp-tokendeploy/Overview/Owner/owner.css
+++ /dev/null
@@ -1,54 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.info {
-}
-
-.owner {
- vertical-align: top;
- text-align: right;
-}
-
-.owner>div {
- border-radius: 1px;
- padding: 1em 2em;
- white-space: nowrap;
-}
-
-.tokens {
- text-align: left;
-}
-
-.tokens>div {
- border-radius: 1px;
- background: #988;
- padding: 1em;
- margin: 0 0 0.25em 0.25em;
- display: inline-block;
- white-space: nowrap;
- color: white;
-}
-
-.icon {
- margin: 0 0 -4px 1em;
-}
-
-.byline {
- opacity: 0.75;
- font-size: 0.75em;
- padding-top: 0.25em;
-}
diff --git a/js/packages/dapp-tokendeploy/Overview/Owner/owner.js b/js/packages/dapp-tokendeploy/Overview/Owner/owner.js
deleted file mode 100644
index 6d9f6fcbe..000000000
--- a/js/packages/dapp-tokendeploy/Overview/Owner/owner.js
+++ /dev/null
@@ -1,80 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-
-import IdentityIcon from '../../IdentityIcon';
-import Token from '../Token';
-import styles from './owner.css';
-
-export default class Owner extends Component {
- static contextTypes = {
- accounts: PropTypes.object.isRequired,
- managerInstance: PropTypes.object.isRequired
- }
-
- static propTypes = {
- address: PropTypes.string.isRequired,
- tokens: PropTypes.array.isRequired
- }
-
- state = {
- tokens: []
- }
-
- render () {
- const { accounts } = this.context;
- const { address, tokens } = this.props;
-
- if (!tokens.length) {
- return null;
- }
-
- return (
-
- ));
- }
-}
diff --git a/js/packages/dapp-tokendeploy/Overview/Token/index.js b/js/packages/dapp-tokendeploy/Overview/Token/index.js
deleted file mode 100644
index 6a636c3c8..000000000
--- a/js/packages/dapp-tokendeploy/Overview/Token/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './token';
diff --git a/js/packages/dapp-tokendeploy/Overview/Token/token.css b/js/packages/dapp-tokendeploy/Overview/Token/token.css
deleted file mode 100644
index 48153a4b2..000000000
--- a/js/packages/dapp-tokendeploy/Overview/Token/token.css
+++ /dev/null
@@ -1,53 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.info {
-}
-
-.info>div {
- display: inline-block;
- padding: 0.25em 0.5em;
- vertical-align: middle;
-}
-
-.address {
-}
-
-.tla {
- background: #766;
- border-radius: 1px;
-}
-
-.name {
-}
-
-.supply {
-}
-
-.supply div {
- display: block;
- text-align: center;
-}
-
-.supply .info {
- font-size: 0.75em;
- opacity: 0.75;
-}
-
-.global {
- font-size: 0.75em;
-}
diff --git a/js/packages/dapp-tokendeploy/Overview/Token/token.js b/js/packages/dapp-tokendeploy/Overview/Token/token.js
deleted file mode 100644
index 469ee2089..000000000
--- a/js/packages/dapp-tokendeploy/Overview/Token/token.js
+++ /dev/null
@@ -1,69 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-
-import { totalSupply, getCoin } from '../../services';
-import styles from './token.css';
-
-export default class Token extends Component {
- static propTypes = {
- address: PropTypes.string.isRequired,
- tokenreg: PropTypes.string.isRequired
- }
-
- state = {
- coin: null,
- totalSupply: null
- }
-
- componentDidMount () {
- this.lookupToken();
- }
-
- render () {
- const { coin, totalSupply } = this.state;
-
- if (!coin) {
- return null;
- }
-
- return (
-
-
{ coin.tla }
-
{ coin.name }
-
-
{ totalSupply.div(1000000).toFormat(0) }
-
total supply
-
-
- );
- }
-
- lookupToken () {
- const { address, tokenreg } = this.props;
-
- Promise
- .all([
- getCoin(tokenreg, address),
- totalSupply(address)
- ])
- .then(([coin, totalSupply]) => {
- this.setState({ coin, totalSupply });
- });
- }
-}
diff --git a/js/packages/dapp-tokendeploy/Overview/index.js b/js/packages/dapp-tokendeploy/Overview/index.js
deleted file mode 100644
index b6317c834..000000000
--- a/js/packages/dapp-tokendeploy/Overview/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './overview';
diff --git a/js/packages/dapp-tokendeploy/Overview/overview.css b/js/packages/dapp-tokendeploy/Overview/overview.css
deleted file mode 100644
index c1c05fd3d..000000000
--- a/js/packages/dapp-tokendeploy/Overview/overview.css
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-@import '../_status.css';
-
-.body {
-}
-
-.ownerTable {
- margin: 0 auto;
- border-collapse: collapse;
-}
diff --git a/js/packages/dapp-tokendeploy/Overview/overview.js b/js/packages/dapp-tokendeploy/Overview/overview.js
deleted file mode 100644
index 7c0fe248b..000000000
--- a/js/packages/dapp-tokendeploy/Overview/overview.js
+++ /dev/null
@@ -1,106 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import BigNumber from 'bignumber.js';
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-
-import { loadOwnedTokens } from '../services';
-import Container from '../Container';
-import Owner from './Owner';
-
-import styles from './overview.css';
-
-export default class Overview extends Component {
- static contextTypes = {
- accounts: PropTypes.object.isRequired,
- managerInstance: PropTypes.object.isRequired
- }
-
- state = {
- loading: true,
- total: new BigNumber(0),
- tokenOwners: []
- }
-
- componentDidMount () {
- this.loadOwners();
- }
-
- render () {
- const { loading } = this.state;
-
- return (
-
- { loading ? this.renderLoading() : this.renderBody() }
-
- );
- }
-
- renderLoading () {
- return (
-
- You have { total.toFormat(0) } tokens created by your accounts
-
- { owners }
-
- );
- }
-
- renderOwners () {
- const { tokens } = this.state;
-
- return Object.keys(tokens).map((address) => (
-
- ));
- }
-
- loadOwners () {
- const { accounts } = this.context;
- const addresses = Object.keys(accounts);
-
- loadOwnedTokens(addresses)
- .then(({ tokens, total }) => {
- this.setState({ tokens, total, loading: false });
- });
- }
-}
diff --git a/js/packages/dapp-tokendeploy/Transfer/Event/event.js b/js/packages/dapp-tokendeploy/Transfer/Event/event.js
deleted file mode 100644
index 225db9312..000000000
--- a/js/packages/dapp-tokendeploy/Transfer/Event/event.js
+++ /dev/null
@@ -1,107 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-// TODO: This is a copy & paste for Deploy/Event -> render() different. Not very DRY
-import moment from 'moment';
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-
-import { api } from '../../parity';
-import { txLink } from '../../services';
-import IdentityIcon from '../../IdentityIcon';
-import styles from '../../Deploy/Event/event.css';
-
-export default class Event extends Component {
- static contextTypes = {
- accounts: PropTypes.object.isRequired,
- registryInstance: PropTypes.object.isRequired,
- tokenregInstance: PropTypes.object.isRequired
- }
-
- static propTypes = {
- event: PropTypes.object.isRequired,
- token: PropTypes.object.isRequired
- }
-
- state = {
- block: null
- }
-
- componentDidMount () {
- this.lookup();
- }
-
- render () {
- const { event, token } = this.props;
- const { block } = this.state;
- const isPending = event.type === 'pending';
-
- return (
-
- );
- }
-
- renderHash (hash) {
- return `${hash.substr(0, 10)}...${hash.slice(-10)}`;
- }
-
- lookup () {
- const { event } = this.props;
-
- if (event.type === 'pending') {
- return;
- }
-
- api.parity
- .getBlockHeaderByNumber(event.blockNumber)
- .then((block) => {
- this.setState({ block });
- });
- }
-}
diff --git a/js/packages/dapp-tokendeploy/Transfer/Event/index.js b/js/packages/dapp-tokendeploy/Transfer/Event/index.js
deleted file mode 100644
index 25441954b..000000000
--- a/js/packages/dapp-tokendeploy/Transfer/Event/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './event';
diff --git a/js/packages/dapp-tokendeploy/Transfer/Events/events.js b/js/packages/dapp-tokendeploy/Transfer/Events/events.js
deleted file mode 100644
index d6b359133..000000000
--- a/js/packages/dapp-tokendeploy/Transfer/Events/events.js
+++ /dev/null
@@ -1,151 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-
-import { api } from '../../parity';
-import { loadAllTokens, subscribeEvents, unsubscribeEvents } from '../../services';
-import Container from '../../Container';
-import Event from '../Event';
-
-import styles from '../../Deploy/Events/events.css';
-
-export default class Events extends Component {
- state = {
- subscriptionId: 0,
- loading: true,
- events: [],
- pendingEvents: [],
- minedEvents: [],
- tokens: []
- }
-
- componentDidMount () {
- loadAllTokens()
- .then((tokens) => {
- const addresses = tokens.map((token) => token.address);
-
- this.setState({ tokens });
- return subscribeEvents(addresses, this.eventCallback);
- })
- .then((subscriptionId) => {
- this.setState({ subscriptionId, loading: false });
- })
- .catch((error) => {
- console.error('componentDidMount', error);
- });
- }
-
- componentWillUnmount () {
- const { subscriptionId } = this.state;
-
- if (subscriptionId) {
- unsubscribeEvents(subscriptionId);
- }
- }
-
- render () {
- const { loading } = this.state;
-
- return (
-
- { loading ? this.renderLoading() : this.renderEvents() }
-
- );
- }
-
- renderLoading () {
- return (
-
- );
- }
-
- logToEvent = (log) => {
- log.key = api.util.sha3(JSON.stringify(log));
- log.params = Object.keys(log.params).reduce((params, name) => {
- params[name] = log.params[name].value;
- return params;
- }, {});
-
- return log;
- }
-
- eventCallback = (error, logs) => {
- if (error) {
- console.error('eventCallback', error);
- return;
- }
-
- const { minedEvents, pendingEvents } = this.state;
- const minedNew = logs
- .filter((log) => log.type === 'mined')
- .map(this.logToEvent)
- .filter((log) => !minedEvents.find((event) => event.transactionHash === log.transactionHash))
- .reverse()
- .concat(minedEvents);
- const pendingNew = logs
- .filter((log) => log.type === 'pending')
- .map(this.logToEvent)
- .filter((log) => !pendingEvents.find((event) => event.transactionHash === log.transactionHash))
- .reverse()
- .concat(pendingEvents)
- .filter((log) => !minedNew.find((event) => event.transactionHash === log.transactionHash));
- const events = [].concat(pendingNew).concat(minedNew);
-
- this.setState({ loading: false, events, minedEvents: minedNew, pendingEvents: pendingNew });
- }
-}
diff --git a/js/packages/dapp-tokendeploy/Transfer/Events/index.js b/js/packages/dapp-tokendeploy/Transfer/Events/index.js
deleted file mode 100644
index d2d0080b3..000000000
--- a/js/packages/dapp-tokendeploy/Transfer/Events/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './events';
diff --git a/js/packages/dapp-tokendeploy/Transfer/Send/index.js b/js/packages/dapp-tokendeploy/Transfer/Send/index.js
deleted file mode 100644
index 58c273dc7..000000000
--- a/js/packages/dapp-tokendeploy/Transfer/Send/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './send';
diff --git a/js/packages/dapp-tokendeploy/Transfer/Send/send.css b/js/packages/dapp-tokendeploy/Transfer/Send/send.css
deleted file mode 100644
index 1403a3df1..000000000
--- a/js/packages/dapp-tokendeploy/Transfer/Send/send.css
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-@import '../../_form.css';
-@import '../../_status.css';
diff --git a/js/packages/dapp-tokendeploy/Transfer/Send/send.js b/js/packages/dapp-tokendeploy/Transfer/Send/send.js
deleted file mode 100644
index 9b08b5d65..000000000
--- a/js/packages/dapp-tokendeploy/Transfer/Send/send.js
+++ /dev/null
@@ -1,346 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import BigNumber from 'bignumber.js';
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-
-import { eip20 } from '@parity/shared/contracts/abi';
-
-import { api } from '../../parity';
-import { loadBalances } from '../../services';
-import AddressSelect from '../../AddressSelect';
-import Container from '../../Container';
-
-import styles from './send.css';
-
-export default class Send extends Component {
- static contextTypes = {
- accounts: PropTypes.object.isRequired
- }
-
- state = {
- loading: true,
- tokens: null,
- selectedToken: null,
- availableBalances: [],
- fromAddress: null,
- fromBalance: null,
- toAddress: null,
- toKnown: true,
- amount: 0,
- amountError: null,
- sendBusy: false,
- sendError: null,
- sendState: null,
- sendDone: false,
- signerRequestId: null,
- txHash: null,
- txReceipt: null
- }
-
- componentDidMount () {
- this.loadBalances();
- this.onAmountChange({ target: { value: '0' } });
- }
-
- render () {
- const { loading } = this.state;
-
- return loading
- ? this.renderLoading()
- : this.renderBody();
- }
-
- renderBody () {
- const { sendBusy } = this.state;
-
- return sendBusy
- ? this.renderSending()
- : this.renderForm();
- }
-
- renderSending () {
- const { sendDone, sendError, sendState } = this.state;
-
- if (sendDone) {
- return (
-
-
-
- );
- }
-
- renderTokens () {
- const { tokens } = this.state;
-
- return tokens.map((token) => (
-
- ));
- }
-
- onSelectFrom = (event) => {
- const fromAddress = event.target.value;
-
- this.setState({ fromAddress });
- }
-
- onChangeTo = (event) => {
- const toAddress = event.target.value;
-
- this.setState({ toAddress });
- }
-
- onChangeToType = (event) => {
- const toKnown = event.target.value === 'known';
-
- this.setState({ toKnown });
- }
-
- onSelectToken = (event) => {
- const { tokens } = this.state;
- const address = event.target.value;
- const selectedToken = tokens.find((_token) => _token.address === address);
- const availableBalances = selectedToken.balances.filter((balance) => balance.balance.gt(0));
-
- this.setState({ selectedToken, availableBalances });
- this.onSelectFrom({ target: { value: availableBalances[0].address } });
- }
-
- onAmountChange = (event) => {
- const amount = parseFloat(event.target.value);
- const amountError = !isFinite(amount) || amount <= 0
- ? 'amount needs to be > 0'
- : null;
-
- this.setState({ amount, amountError });
- }
-
- onSend = () => {
- const { amount, fromAddress, toAddress, amountError, selectedToken, sendBusy } = this.state;
- const hasError = amountError;
-
- if (hasError || sendBusy) {
- return;
- }
-
- const values = [toAddress, new BigNumber(amount).mul(1000000).toFixed(0)];
- const options = {
- from: fromAddress
- };
- const instance = api.newContract(eip20, selectedToken.address).instance;
-
- this.setState({ sendBusy: true, sendState: 'Estimating gas for the transaction' });
-
- instance
- .transfer.estimateGas(options, values)
- .then((gas) => {
- this.setState({ sendState: 'Gas estimated, Posting transaction to the network' });
-
- const gasPassed = gas.mul(1.2);
-
- options.gas = gasPassed.toFixed(0);
- console.log(`gas estimated at ${gas.toFormat(0)}, passing ${gasPassed.toFormat(0)}`);
-
- return instance.transfer.postTransaction(options, values);
- })
- .then((signerRequestId) => {
- this.setState({ signerRequestId, sendState: 'Transaction posted, Waiting for transaction authorization' });
-
- return api.pollMethod('parity_checkRequest', signerRequestId);
- })
- .then((txHash) => {
- this.setState({ txHash, sendState: 'Transaction authorized, Waiting for network confirmations' });
-
- return api.pollMethod('eth_getTransactionReceipt', txHash, (receipt) => {
- if (!receipt || !receipt.blockNumber || receipt.blockNumber.eq(0)) {
- return false;
- }
-
- return true;
- });
- })
- .then((txReceipt) => {
- this.setState({ txReceipt, sendDone: true, sendState: 'Network confirmed, Received transaction receipt' });
- })
- .catch((error) => {
- console.error('onSend', error);
- this.setState({ sendError: error.message });
- });
- }
-
- loadBalances () {
- const { accounts } = this.context;
- const addresses = Object.keys(accounts);
-
- loadBalances(addresses)
- .then((_tokens) => {
- const tokens = _tokens.filter((token) => {
- for (let index = 0; index < token.balances.length; index++) {
- if (token.balances[index].balance.gt(0)) {
- return true;
- }
- }
-
- return false;
- });
-
- this.setState({ tokens, loading: false });
-
- if (tokens.length > 0) {
- this.onSelectToken({ target: { value: tokens[0].address } });
- }
- });
- }
-}
diff --git a/js/packages/dapp-tokendeploy/Transfer/index.js b/js/packages/dapp-tokendeploy/Transfer/index.js
deleted file mode 100644
index e366ead6d..000000000
--- a/js/packages/dapp-tokendeploy/Transfer/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './transfer';
diff --git a/js/packages/dapp-tokendeploy/Transfer/transfer.js b/js/packages/dapp-tokendeploy/Transfer/transfer.js
deleted file mode 100644
index 2c5fc0308..000000000
--- a/js/packages/dapp-tokendeploy/Transfer/transfer.js
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-
-import Events from './Events';
-import Send from './Send';
-
-export default class Transfer extends Component {
- render () {
- return (
-
-
-
-
- );
- }
-}
diff --git a/js/packages/dapp-tokendeploy/_form.css b/js/packages/dapp-tokendeploy/_form.css
deleted file mode 100644
index 13e127276..000000000
--- a/js/packages/dapp-tokendeploy/_form.css
+++ /dev/null
@@ -1,108 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.button {
- background: #622;
-}
-
-.form {
- text-align: left;
- margin: 0 auto;
- display: inline-block;
-}
-
-.form .input {
- align-items: center;
- display: flex;
- flex-wrap: wrap;
- margin-bottom: 1.5em;
-}
-
-.form .input * {
- display: inline-block;
- margin: 0 0.5em;
- font-size: 1em;
-}
-
-.form .input label {
- width: 25em;
- opacity: 0.8;
- text-align: right;
-}
-
-.form .hint {
- width: 25em;
- opacity: 0.5;
-}
-
-.form .input input,
-.form .input select {
- width: 18em;
- color: #444;
- background: rgba(255, 255, 255, 0.75);
- border-radius: 1px;
- border: 1px solid rgba(0, 0, 0, 0.25);
- box-sizing: border-box;
- -moz-appearance: none;
- -webkit-appearance: none;
- appearance: none;
- padding: 0.5em;
-}
-
-.form select {
- height: 36px;
-}
-
-.form input.small {
- width: 9em;
- margin-right: 9.5em;
-}
-
-.form .error input {
- border: 1px solid rgba(255, 0, 0, 0.5);
- color: red;
- background: rgba(255, 0, 0, 0.1);
-}
-
-.form .error label {
- color: red;
-}
-
-.form .error .hint {
- color: red;
-}
-
-.buttonRow {
- text-align: right;
- width: 18em;
-}
-
-.button {
- color: white;
- border: none;
- border-radius: 1px;
- padding: 1em 2em !important;
- display: inline-block;
- margin-left: 1em !important;
- cursor: pointer;
- position: relative;
-}
-
-.button[disabled] {
- opacity: 0.5;
- cursor: default;
-}
diff --git a/js/packages/dapp-tokendeploy/_status.css b/js/packages/dapp-tokendeploy/_status.css
deleted file mode 100644
index 2d93e1c0a..000000000
--- a/js/packages/dapp-tokendeploy/_status.css
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.statusHeader {
- font-size: 1.25em;
- margin-bottom: 1.25em;
- opacity: 0.75;
-}
-
-.statusInfo {
- margin-bottom: 0.25em;
-}
-
-.statusState {
- opacity: 0.75;
- margin-top: 1em;
-}
-
-.statusError {
- color: red;
- margin-top: 1em;
-}
diff --git a/js/packages/dapp-tokendeploy/background.jpg b/js/packages/dapp-tokendeploy/background.jpg
deleted file mode 100644
index c873064f5..000000000
Binary files a/js/packages/dapp-tokendeploy/background.jpg and /dev/null differ
diff --git a/js/packages/dapp-tokendeploy/index.js b/js/packages/dapp-tokendeploy/index.js
deleted file mode 100644
index 99bbc6285..000000000
--- a/js/packages/dapp-tokendeploy/index.js
+++ /dev/null
@@ -1,68 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import ReactDOM from 'react-dom';
-import React from 'react';
-import { Redirect, Router, Route, hashHistory } from 'react-router';
-import { AppContainer } from 'react-hot-loader';
-
-import injectTapEventPlugin from 'react-tap-event-plugin';
-injectTapEventPlugin();
-
-import Deploy from './Deploy';
-import Application from './Application';
-import Overview from './Overview';
-import Transfer from './Transfer';
-
-import '@parity/shared/assets/fonts/Roboto/font.css';
-import '@parity/shared/assets/fonts/RobotoMono/font.css';
-import '@parity/dapps/style.css';
-
-ReactDOM.render(
-
-
-
-
-
-
-
-
-
- ,
- document.querySelector('#container')
-);
-
-if (module.hot) {
- module.hot.accept('./Application/index.js', () => {
- require('./Application/index.js');
- require('./Overview/index.js');
- require('./Transfer/index.js');
-
- ReactDOM.render(
-
-
-
-
-
-
-
-
-
- ,
- document.querySelector('#container')
- );
- });
-}
diff --git a/js/packages/dapp-tokendeploy/package.json b/js/packages/dapp-tokendeploy/package.json
deleted file mode 100644
index 73edf113b..000000000
--- a/js/packages/dapp-tokendeploy/package.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "name": "@parity/dapp-tokendeploy",
- "description": "Parity basic token deployment",
- "version": "1.99.99",
- "main": "index.js",
- "author": "Parity Team ",
- "maintainers": [],
- "contributors": [],
- "license": "GPL-3.0",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/paritytech/dapp-tokendeploy.git"
- },
- "keywords": [],
- "scripts": {},
- "devDependencies": {},
- "dependencies": {
- },
- "peerDependencies": {}
-}
diff --git a/js/packages/dapp-tokendeploy/parity.js b/js/packages/dapp-tokendeploy/parity.js
deleted file mode 100644
index 742386288..000000000
--- a/js/packages/dapp-tokendeploy/parity.js
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import Api from '@parity/api';
-
-const ethereumProvider = window.ethereum || window.parent.ethereum;
-
-if (!ethereumProvider) {
- throw new Error('Unable to locate EthereumProvider, object not attached');
-}
-
-const api = new Api(ethereumProvider);
-
-export {
- api
-};
diff --git a/js/packages/dapp-tokendeploy/services.js b/js/packages/dapp-tokendeploy/services.js
deleted file mode 100644
index bd8f87ddc..000000000
--- a/js/packages/dapp-tokendeploy/services.js
+++ /dev/null
@@ -1,294 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import BigNumber from 'bignumber.js';
-
-import { url as etherscanUrl } from '@parity/etherscan/links';
-import * as abis from '@parity/shared/contracts/abi';
-
-import { api } from './parity';
-
-let managerInstance;
-let tokenregInstance;
-let registryInstance;
-
-const registries = {};
-const subscriptions = {};
-
-let defaultSubscriptionId;
-let nextSubscriptionId = 1000;
-let netVersion = '0';
-
-export function subscribeEvents (addresses, callback) {
- const subscriptionId = nextSubscriptionId++;
- const contract = api.newContract(abis.eip20);
- const event = contract.events.filter((evt) => evt.name === 'Transfer');
- const options = {
- address: addresses,
- fromBlock: 0,
- toBlock: 'pending',
- limit: 50,
- topics: [event.signature]
- };
-
- return api.eth
- .newFilter(options)
- .then((filterId) => {
- subscriptions[subscriptionId] = { subscriptionId, filterId, addresses, callback, contract };
-
- return api.eth.getFilterLogs(filterId);
- })
- .then((logs) => callback(null, contract.parseEventLogs(logs)))
- .then(() => subscriptionId)
- .catch((error) => {
- console.error('subscribeEvents', error);
- throw error;
- });
-}
-
-export function unsubscribeEvents (subscriptionId) {
- api.eth
- .uninstallFilter(subscriptions[subscriptionId].filterId)
- .catch((error) => {
- console.error('unsubscribeEvents', error);
- });
-
- delete subscriptions[subscriptionId];
-}
-
-export function subscribeDefaultAddress (callback) {
- return api
- .subscribe('parity_defaultAccount', callback)
- .then((subscriptionId) => {
- defaultSubscriptionId = subscriptionId;
-
- return defaultSubscriptionId;
- });
-}
-
-export function unsubscribeDefaultAddress () {
- return api.unsubscribe(defaultSubscriptionId);
-}
-
-function pollEvents () {
- const loop = Object.values(subscriptions);
- const timeout = () => setTimeout(pollEvents, 1000);
-
- Promise
- .all(loop.map((subscription) => api.eth.getFilterChanges(subscription.filterId)))
- .then((logsArray) => {
- logsArray.forEach((logs, index) => {
- const subscription = loop[index];
-
- if (!logs || !logs.length) {
- return;
- }
-
- try {
- subscription.callback(null, subscription.contract.parseEventLogs(logs));
- } catch (error) {
- unsubscribeEvents(loop.subscriptionId);
- console.error('pollEvents', error);
- }
- });
-
- timeout();
- })
- .catch((error) => {
- console.error('pollEvents', error);
- timeout();
- });
-}
-
-export function attachInstances () {
- pollEvents();
-
- return Promise
- .all([
- api.parity.registryAddress(),
- api.parity.netChain(),
- api.net.version()
- ])
- .then(([registryAddress, netChain, _netVersion]) => {
- const registry = api.newContract(abis.registry, registryAddress).instance;
-
- netVersion = _netVersion;
-
- console.log(`contract was found at registry=${registryAddress}`);
- console.log(`running on ${netChain}, network ${netVersion}`);
-
- return Promise
- .all([
- registry.getAddress.call({}, [api.util.sha3('basiccoinmgr'), 'A']),
- registry.getAddress.call({}, [api.util.sha3('basiccoinreg'), 'A']),
- registry.getAddress.call({}, [api.util.sha3('tokenreg'), 'A'])
- ]);
- })
- .then(([managerAddress, registryAddress, tokenregAddress]) => {
- console.log(`contracts were found at basiccoinmgr=${managerAddress}, basiccoinreg=${registryAddress}, tokenreg=${tokenregAddress}`);
-
- managerInstance = api.newContract(abis.basiccoinmanager, managerAddress).instance;
- registryInstance = api.newContract(abis.tokenreg, registryAddress).instance;
- tokenregInstance = api.newContract(abis.tokenreg, tokenregAddress).instance;
-
- registries[registryInstance.address] = registryInstance;
- registries[tokenregInstance.address] = tokenregInstance;
-
- return {
- managerInstance,
- registryInstance,
- tokenregInstance
- };
- })
- .catch((error) => {
- console.error('attachInstances', error);
- throw error;
- });
-}
-
-export function totalSupply (address) {
- return api.newContract(abis.eip20, address)
- .instance.totalSupply.call();
-}
-
-export function getCoin (tokenreg, address) {
- return registries[tokenreg].fromAddress
- .call({}, [address])
- .then(([id, tla, base, name, owner]) => {
- return {
- id, tla, base, name, owner,
- isGlobal: tokenregInstance.address === tokenreg
- };
- })
- .catch((error) => {
- console.error('getCoin', error);
- throw error;
- });
-}
-
-export function loadOwnedTokens (addresses) {
- let total = new BigNumber(0);
-
- return Promise
- .all(
- addresses.map((address) => managerInstance.countByOwner.call({}, [address]))
- )
- .then((counts) => {
- return Promise.all(
- addresses.reduce((promises, address, index) => {
- total = counts[index].add(total);
- for (let i = 0; counts[index].gt(i); i++) {
- promises.push(managerInstance.getByOwner.call({}, [address, i]));
- }
- return promises;
- }, [])
- );
- })
- .then((_tokens) => {
- const tokens = _tokens.reduce((tokens, token) => {
- const [address, owner, tokenreg] = token;
-
- tokens[owner] = tokens[owner] || [];
- tokens[owner].push({ address, owner, tokenreg });
- return tokens;
- }, {});
-
- return { tokens, total };
- })
- .catch((error) => {
- console.error('loadTokens', error);
- throw error;
- });
-}
-
-export function loadAllTokens () {
- return managerInstance
- .count.call()
- .then((count) => {
- const promises = [];
-
- for (let index = 0; count.gt(index); index++) {
- promises.push(managerInstance.get.call({}, [index]));
- }
-
- return Promise.all(promises);
- })
- .then((_tokens) => {
- const tokens = [];
-
- return Promise
- .all(
- _tokens.map(([address, owner, tokenreg]) => {
- const isGlobal = tokenreg === tokenregInstance.address;
-
- tokens.push({ address, owner, tokenreg, isGlobal });
- return registries[tokenreg].fromAddress.call({}, [address]);
- })
- )
- .then((coins) => {
- return tokens.map((token, index) => {
- const [id, tla, base, name, owner] = coins[index];
-
- token.coin = { id, tla, base, name, owner };
- return token;
- });
- });
- })
- .catch((error) => {
- console.log('loadAllTokens', error);
- throw error;
- });
-}
-
-export function loadBalances (addresses) {
- return loadAllTokens()
- .then((tokens) => {
- return Promise.all(
- tokens.map((token) => {
- return Promise.all(
- addresses.map((address) => loadTokenBalance(token.address, address))
- );
- })
- )
- .then((_balances) => {
- return tokens.map((token, tindex) => {
- const balances = _balances[tindex];
-
- token.balances = addresses.map((address, aindex) => {
- return { address, balance: balances[aindex] };
- });
- return token;
- });
- });
- })
- .catch((error) => {
- console.error('loadBalances', error);
- throw error;
- });
-}
-
-export function loadTokenBalance (tokenAddress, address) {
- return api.newContract(abis.eip20, tokenAddress).instance
- .balanceOf.call({}, [address])
- .catch((error) => {
- console.error('loadTokenBalance', error);
- throw error;
- });
-}
-
-export function txLink (txHash) {
- return `https://${etherscanUrl(false, netVersion)}/tx/${txHash}`;
-}
diff --git a/js/packages/dapp-tokenreg/Accounts/AccountSelector/account-selector.css b/js/packages/dapp-tokenreg/Accounts/AccountSelector/account-selector.css
deleted file mode 100644
index 85f57699b..000000000
--- a/js/packages/dapp-tokenreg/Accounts/AccountSelector/account-selector.css
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.account-selector {
-}
-
-.avatar > img {
- margin: 0;
- width: 100%;
- height: 100%;
-}
diff --git a/js/packages/dapp-tokenreg/Accounts/AccountSelector/account-selector.js b/js/packages/dapp-tokenreg/Accounts/AccountSelector/account-selector.js
deleted file mode 100644
index b5c070d63..000000000
--- a/js/packages/dapp-tokenreg/Accounts/AccountSelector/account-selector.js
+++ /dev/null
@@ -1,131 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import { List, ListItem } from 'material-ui/List';
-import Subheader from 'material-ui/Subheader';
-import Avatar from 'material-ui/Avatar';
-import PropTypes from 'prop-types';
-
-import IdentityIcon from '../../IdentityIcon';
-
-import styles from './account-selector.css';
-
-class AccountSelectorItem extends Component {
- static propTypes = {
- onSelectAccount: PropTypes.func.isRequired,
- account: PropTypes.object.isRequired
- };
-
- render () {
- const account = this.props.account;
-
- const props = Object.assign({}, this.props);
-
- delete props.account;
- delete props.onSelectAccount;
-
- const icon = (
-
- );
-
- const avatar = (
-
- );
-
- return (
-
- );
- }
-
- onSelectAccount = () => {
- this.props.onSelectAccount(this.props.account.address);
- }
-}
-
-export default class AccountSelector extends Component {
- static propTypes = {
- list: PropTypes.array.isRequired,
- selected: PropTypes.object.isRequired,
- handleSetSelected: PropTypes.func.isRequired,
- onAccountChange: PropTypes.func
- };
-
- state = {
- open: false
- };
-
- render () {
- const nestedAccounts = this.renderAccounts(this.props.list);
- const selectedAccount = (
-
- );
-
- return (
-
-
- Select an account
- { selectedAccount }
-
-
- );
- }
-
- renderAccounts (accounts) {
- return accounts
- .map((account, index) => (
-
- ));
- }
-
- onToggleOpen = () => {
- this.setState({ open: !this.state.open });
-
- if (typeof this.props.onAccountChange === 'function') {
- this.props.onAccountChange();
- }
- }
-
- onSelectAccount = (address) => {
- this.props.handleSetSelected(address);
- this.onToggleOpen();
- }
-}
diff --git a/js/packages/dapp-tokenreg/Accounts/AccountSelector/container.js b/js/packages/dapp-tokenreg/Accounts/AccountSelector/container.js
deleted file mode 100644
index 2ad420478..000000000
--- a/js/packages/dapp-tokenreg/Accounts/AccountSelector/container.js
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import { connect } from 'react-redux';
-
-import AccountSelector from './account-selector';
-
-import { setSelectedAccount } from '../actions';
-
-class AccountSelectorContainer extends Component {
- render () {
- return (
-
- );
- }
-}
-
-const mapStateToProps = (state) => {
- const { accounts } = state;
-
- return { ...accounts };
-};
-
-const mapDispatchToProps = (dispatch) => {
- return {
- handleSetSelected: (address) => {
- dispatch(setSelectedAccount(address));
- }
- };
-};
-
-export default connect(
- mapStateToProps,
- mapDispatchToProps
-)(AccountSelectorContainer);
diff --git a/js/packages/dapp-tokenreg/Accounts/AccountSelector/index.js b/js/packages/dapp-tokenreg/Accounts/AccountSelector/index.js
deleted file mode 100644
index 0deedaecc..000000000
--- a/js/packages/dapp-tokenreg/Accounts/AccountSelector/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './container';
diff --git a/js/packages/dapp-tokenreg/Accounts/actions.js b/js/packages/dapp-tokenreg/Accounts/actions.js
deleted file mode 100644
index 538f1a831..000000000
--- a/js/packages/dapp-tokenreg/Accounts/actions.js
+++ /dev/null
@@ -1,55 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { api } from '../parity';
-
-export const SET_ACCOUNTS = 'SET_ACCOUNTS';
-export const setAccounts = (accounts) => ({
- type: SET_ACCOUNTS,
- accounts
-});
-
-export const SET_ACCOUNTS_INFO = 'SET_ACCOUNTS_INFO';
-export const setAccountsInfo = (accountsInfo) => ({
- type: SET_ACCOUNTS_INFO,
- accountsInfo
-});
-
-export const SET_SELECTED_ACCOUNT = 'SET_SELECTED_ACCOUNT';
-export const setSelectedAccount = (address) => ({
- type: SET_SELECTED_ACCOUNT,
- address
-});
-
-export const loadAccounts = () => (dispatch) => {
- api.parity
- .accountsInfo()
- .then((accountsInfo) => {
- const accountsList = Object
- .keys(accountsInfo)
- .map((address) => ({
- ...accountsInfo[address],
- address
- }));
-
- dispatch(setAccounts(accountsList));
- dispatch(setAccountsInfo(accountsInfo));
- dispatch(setSelectedAccount(accountsList[0].address));
- })
- .catch(e => {
- console.error('loadAccounts error', e);
- });
-};
diff --git a/js/packages/dapp-tokenreg/Accounts/reducer.js b/js/packages/dapp-tokenreg/Accounts/reducer.js
deleted file mode 100644
index 06a0cae92..000000000
--- a/js/packages/dapp-tokenreg/Accounts/reducer.js
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import {
- SET_ACCOUNTS,
- SET_SELECTED_ACCOUNT,
- SET_ACCOUNTS_INFO
-} from './actions';
-
-const initialState = {
- list: [],
- accountsInfo: {},
- selected: null
-};
-
-export default (state = initialState, action) => {
- switch (action.type) {
- case SET_ACCOUNTS:
- return {
- ...state,
- list: [].concat(action.accounts)
- };
-
- case SET_ACCOUNTS_INFO:
- return {
- ...state,
- accountsInfo: { ...action.accountsInfo }
- };
-
- case SET_SELECTED_ACCOUNT: {
- const address = action.address;
- const account = state.list.find(a => a.address === address);
-
- return {
- ...state,
- selected: account
- };
- }
-
- default:
- return state;
- }
-};
-
diff --git a/js/packages/dapp-tokenreg/Actions/Query/index.js b/js/packages/dapp-tokenreg/Actions/Query/index.js
deleted file mode 100644
index a0bf54b4b..000000000
--- a/js/packages/dapp-tokenreg/Actions/Query/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './query';
diff --git a/js/packages/dapp-tokenreg/Actions/Query/query.js b/js/packages/dapp-tokenreg/Actions/Query/query.js
deleted file mode 100644
index ff99e0685..000000000
--- a/js/packages/dapp-tokenreg/Actions/Query/query.js
+++ /dev/null
@@ -1,218 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-
-import { Dialog, FlatButton, SelectField, MenuItem } from 'material-ui';
-
-import InputText from '../../Inputs/Text';
-import Loading from '../../Loading';
-import Token from '../../Tokens/Token';
-
-import { SIMPLE_TOKEN_ADDRESS_TYPE, SIMPLE_TLA_TYPE } from '../../Inputs/validation';
-
-import styles from '../actions.css';
-
-const initState = {
- queryKey: 'tla',
- form: {
- valid: false,
- value: ''
- }
-};
-
-export default class QueryAction extends Component {
- static propTypes = {
- show: PropTypes.bool.isRequired,
- loading: PropTypes.bool.isRequired,
-
- onClose: PropTypes.func.isRequired,
- handleQueryToken: PropTypes.func.isRequired,
-
- data: PropTypes.object,
- notFound: PropTypes.bool
- }
-
- state = initState;
-
- render () {
- return (
-
- );
- }
-
- renderActions () {
- const { loading, data, notFound } = this.props;
-
- if (loading) {
- return (
-
- );
- }
-
- const complete = data || notFound;
-
- if (complete) {
- return ([
-
- ]);
- }
-
- const isValid = this.state.form.valid;
-
- return ([
- ,
-
- ]);
- }
-
- renderContent () {
- const { loading, notFound, data } = this.props;
-
- if (loading) {
- return (
-
- );
- }
-
- if (notFound) {
- return (
-
- );
- }
-
- onQueryKeyChange = (event, index, queryKey) => {
- this.setState({
- queryKey,
- form: {
- valid: false,
- value: ''
- }
- });
- }
-
- onChange = (valid, value) => {
- this.setState({
- form: {
- valid,
- value
- }
- });
- }
-
- onQuery = () => {
- if (!this.state.form.valid) {
- return;
- }
-
- const { queryKey, form } = this.state;
-
- this.props.handleQueryToken(queryKey, form.value);
- }
-
- onClose = () => {
- this.setState(initState);
- this.props.onClose();
- }
-}
diff --git a/js/packages/dapp-tokenreg/Actions/Register/index.js b/js/packages/dapp-tokenreg/Actions/Register/index.js
deleted file mode 100644
index a13b62779..000000000
--- a/js/packages/dapp-tokenreg/Actions/Register/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './register';
diff --git a/js/packages/dapp-tokenreg/Actions/Register/register.js b/js/packages/dapp-tokenreg/Actions/Register/register.js
deleted file mode 100644
index 1263d172e..000000000
--- a/js/packages/dapp-tokenreg/Actions/Register/register.js
+++ /dev/null
@@ -1,236 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-
-import { Dialog, FlatButton } from 'material-ui';
-
-import AccountSelector from '../../Accounts/AccountSelector';
-import InputText from '../../Inputs/Text';
-
-import { TOKEN_ADDRESS_TYPE, TLA_TYPE, DECIMAL_TYPE, STRING_TYPE } from '../../Inputs/validation';
-
-import styles from '../actions.css';
-
-const defaultField = { value: '', valid: false };
-const initState = {
- isFormValid: false,
- fields: {
- address: {
- ...defaultField,
- type: TOKEN_ADDRESS_TYPE,
- floatingLabelText: 'Token address',
- hintText: 'The token address'
- },
- tla: {
- ...defaultField,
- type: TLA_TYPE,
- floatingLabelText: 'Token TLA',
- hintText: 'The token short name (3 characters)'
- },
- decimals: {
- ...defaultField,
- type: DECIMAL_TYPE,
- floatingLabelText: 'Token Decimals',
- hintText: 'The number of decimals (0-18)'
- },
- name: {
- ...defaultField,
- type: STRING_TYPE,
- floatingLabelText: 'Token name',
- hintText: 'The token name'
- }
- }
-};
-
-export default class RegisterAction extends Component {
- static propTypes = {
- show: PropTypes.bool.isRequired,
- sending: PropTypes.bool.isRequired,
- complete: PropTypes.bool.isRequired,
- onClose: PropTypes.func.isRequired,
- handleRegisterToken: PropTypes.func.isRequired,
-
- error: PropTypes.object
- }
-
- state = initState;
-
- render () {
- const { sending, error, complete } = this.props;
-
- return (
-
- );
- }
-
- renderActions () {
- const { complete, sending, error } = this.props;
-
- if (error) {
- return (
-
- );
- }
-
- if (complete) {
- return (
-
- );
- }
-
- const isValid = this.state.isFormValid;
-
- return ([
- ,
-
- ]);
- }
-
- renderContent () {
- const { error, complete } = this.props;
-
- if (error) {
- return this.renderError();
- } else if (complete) {
- return this.renderComplete();
- }
-
- return this.renderForm();
- }
-
- renderError () {
- const { error } = this.props;
-
- return (
-
{ error.toString() }
-
);
- }
-
- renderComplete () {
- return (
-
Your transaction has been posted. Please visit the Parity Signer to authenticate the transfer.
-
);
- }
-
- renderForm () {
- return (
-
-
- { this.renderInputs() }
-
- );
- }
-
- renderInputs () {
- const { fields } = this.state;
-
- return Object.keys(fields).map((fieldKey, index) => {
- const onChange = this.onChange.bind(this, fieldKey);
- const field = fields[fieldKey];
-
- return (
-
- );
- });
- }
-
- onAccountChange = () => {
- const { dialog } = this.refs;
-
- dialog.forceUpdate();
- }
-
- onChange (fieldKey, valid, value) {
- const { fields } = this.state;
- const field = fields[fieldKey];
-
- const newFields = {
- ...fields,
- [ fieldKey ]: {
- ...field,
- valid, value
- }
- };
-
- const isFormValid = Object.keys(newFields)
- .map(key => newFields[key].valid)
- .reduce((current, fieldValid) => {
- return current && fieldValid;
- }, true);
-
- this.setState({
- fields: newFields,
- isFormValid
- });
- }
-
- onRegister = () => {
- const { fields } = this.state;
-
- const data = Object.keys(fields)
- .reduce((dataObject, fieldKey) => {
- dataObject[fieldKey] = fields[fieldKey].value;
- return dataObject;
- }, {});
-
- this.props.handleRegisterToken(data);
- }
-
- onClose = () => {
- this.setState(initState);
- this.props.onClose();
- }
-}
diff --git a/js/packages/dapp-tokenreg/Actions/actions.css b/js/packages/dapp-tokenreg/Actions/actions.css
deleted file mode 100644
index aa6fb8d18..000000000
--- a/js/packages/dapp-tokenreg/Actions/actions.css
+++ /dev/null
@@ -1,50 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.actions {
- padding-top: 2rem;
-}
-
-.button {
- margin: 0 0.5em;
-}
-
-.button button {
- background-color: #27ae60 !important;
- height: 56px !important;
- padding: 0 10px !important;
-}
-
-.button button[disabled] {
- background-color: rgba(50, 50, 50, 0.25) !important;
-}
-
-.dialog {
-}
-
-.dialog h3 {
- color: rgba(50, 100, 150, 1) !important;
- text-transform: uppercase;
-}
-
-.dialogtext {
- padding-top: 1em;
-}
-
-.error {
- color: red;
-}
diff --git a/js/packages/dapp-tokenreg/Actions/actions.js b/js/packages/dapp-tokenreg/Actions/actions.js
deleted file mode 100644
index b490e22fb..000000000
--- a/js/packages/dapp-tokenreg/Actions/actions.js
+++ /dev/null
@@ -1,179 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { getTokenTotalSupply } from '../utils';
-
-export const SET_REGISTER_SENDING = 'SET_REGISTER_SENDING';
-export const setRegisterSending = (isSending) => ({
- type: SET_REGISTER_SENDING,
- isSending
-});
-
-export const SET_REGISTER_ERROR = 'SET_REGISTER_ERROR';
-export const setRegisterError = (e) => ({
- type: SET_REGISTER_ERROR,
- error: e
-});
-
-export const REGISTER_RESET = 'REGISTER_RESET';
-export const registerReset = () => ({
- type: REGISTER_RESET
-});
-
-export const REGISTER_COMPLETED = 'REGISTER_COMPLETED';
-export const registerCompleted = () => ({
- type: REGISTER_COMPLETED
-});
-
-export const registerToken = (tokenData) => (dispatch, getState) => {
- const state = getState();
- const contractInstance = state.status.contract.instance;
- const fee = state.status.contract.fee;
-
- const { address, decimals, name, tla } = tokenData;
- const base = Math.pow(10, decimals);
-
- dispatch(setRegisterSending(true));
-
- const values = [ address, tla, base, name ];
- const options = {
- from: state.accounts.selected.address,
- value: fee
- };
-
- Promise.resolve()
- .then(() => {
- return contractInstance
- .fromTLA.call({}, [ tla ])
- .then(([id, address, base, name, owner]) => {
- if (owner !== '0x0000000000000000000000000000000000000000') {
- throw new Error(`A Token has already been registered with the TLA ${tla}`);
- }
- });
- })
- .then(() => {
- return contractInstance
- .fromAddress.call({}, [ address ])
- .then(([id, tla, base, name, owner]) => {
- if (owner !== '0x0000000000000000000000000000000000000000') {
- throw new Error(`A Token has already been registered with the Address ${address}`);
- }
- });
- })
- .then(() => {
- return contractInstance
- .register.estimateGas(options, values);
- })
- .then((gasEstimate) => {
- options.gas = gasEstimate.mul(1.2).toFixed(0);
- return contractInstance.register.postTransaction(options, values);
- })
- .then((result) => {
- dispatch(registerCompleted());
- })
- .catch((e) => {
- console.error('registerToken error', e);
- dispatch(setRegisterError(e));
- });
-};
-
-export const SET_QUERY_LOADING = 'SET_QUERY_LOADING';
-export const setQueryLoading = (isLoading) => ({
- type: SET_QUERY_LOADING,
- isLoading
-});
-
-export const SET_QUERY_RESULT = 'SET_QUERY_RESULT';
-export const setQueryResult = (data) => ({
- type: SET_QUERY_RESULT,
- data
-});
-
-export const SET_QUERY_NOT_FOUND = 'SET_QUERY_NOT_FOUND';
-export const setQueryNotFound = () => ({
- type: SET_QUERY_NOT_FOUND
-});
-
-export const QUERY_RESET = 'QUERY_RESET';
-export const queryReset = () => ({
- type: QUERY_RESET
-});
-
-export const SET_QUERY_META_LOADING = 'SET_QUERY_META_LOADING';
-export const setQueryMetaLoading = (isLoading) => ({
- type: SET_QUERY_META_LOADING,
- isLoading
-});
-
-export const SET_QUERY_META = 'SET_QUERY_META';
-export const setQueryMeta = (data) => ({
- type: SET_QUERY_META,
- data
-});
-
-export const queryToken = (key, query) => (dispatch, getState) => {
- const state = getState();
- const contractInstance = state.status.contract.instance;
-
- const contractFunc = (key === 'tla') ? 'fromTLA' : 'fromAddress';
-
- dispatch(setQueryLoading(true));
-
- contractInstance[contractFunc]
- .call({}, [ query ])
- .then((result) => {
- const data = {
- index: result[0].toNumber(),
- base: result[2].toNumber(),
- name: result[3],
- owner: result[4]
- };
-
- if (key === 'tla') {
- data.tla = query;
- data.address = result[1];
- }
-
- if (key === 'address') {
- data.address = query;
- data.tla = result[1];
- }
-
- return data;
- })
- .then(data => {
- return getTokenTotalSupply(data.address)
- .then(totalSupply => {
- data.totalSupply = totalSupply;
- return data;
- });
- })
- .then(data => {
- if (data.totalSupply === null) {
- dispatch(setQueryNotFound());
- dispatch(setQueryLoading(false));
-
- return false;
- }
-
- data.totalSupply = data.totalSupply.toNumber();
- dispatch(setQueryResult(data));
- dispatch(setQueryLoading(false));
- }, () => {
- dispatch(setQueryNotFound());
- dispatch(setQueryLoading(false));
- });
-};
diff --git a/js/packages/dapp-tokenreg/Actions/component.js b/js/packages/dapp-tokenreg/Actions/component.js
deleted file mode 100644
index 7555a331b..000000000
--- a/js/packages/dapp-tokenreg/Actions/component.js
+++ /dev/null
@@ -1,120 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-
-import { RaisedButton } from 'material-ui';
-import ActionSearchIcon from 'material-ui/svg-icons/action/search';
-import ContentSendIcon from 'material-ui/svg-icons/content/send';
-
-import Register from './Register';
-import Query from './Query';
-
-import styles from './actions.css';
-
-const REGISTER_ACTION = 'REGISTER_ACTION';
-const QUERY_ACTION = 'QUERY_ACTION';
-
-export default class Actions extends Component {
- static propTypes = {
- handleRegisterToken: PropTypes.func.isRequired,
- handleRegisterClose: PropTypes.func.isRequired,
- register: PropTypes.object.isRequired,
-
- handleQueryToken: PropTypes.func.isRequired,
- handleQueryClose: PropTypes.func.isRequired,
- query: PropTypes.object.isRequired
- };
-
- state = {
- show: {
- [ REGISTER_ACTION ]: false,
- [ QUERY_ACTION ]: false
- }
- }
-
- constructor () {
- super();
-
- this.onShowRegister = this.onShow.bind(this, REGISTER_ACTION);
- this.onShowQuery = this.onShow.bind(this, QUERY_ACTION);
- }
-
- render () {
- return (
-
- );
- }
-
- onRegisterClose = () => {
- this.onHide(REGISTER_ACTION);
- this.props.handleRegisterClose();
- }
-
- onQueryClose = () => {
- this.onHide(QUERY_ACTION);
- this.props.handleQueryClose();
- }
-
- onShow (key) {
- this.setState({
- show: {
- ...this.state.show,
- [ key ]: true
- }
- });
- }
-
- onHide (key) {
- this.setState({
- show: {
- ...this.state.show,
- [ key ]: false
- }
- });
- }
-}
diff --git a/js/packages/dapp-tokenreg/Actions/container.js b/js/packages/dapp-tokenreg/Actions/container.js
deleted file mode 100644
index c531af778..000000000
--- a/js/packages/dapp-tokenreg/Actions/container.js
+++ /dev/null
@@ -1,60 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import { connect } from 'react-redux';
-
-import Actions from './component';
-
-import { registerToken, registerReset, queryToken, queryReset } from './actions';
-
-class TokensContainer extends Component {
- render () {
- return (
-
- );
- }
-}
-
-const mapStateToProps = (state) => {
- const { register, query } = state.actions;
-
- return { register, query };
-};
-
-const mapDispatchToProps = (dispatch) => {
- return {
- handleRegisterToken: (tokenData) => {
- dispatch(registerToken(tokenData));
- },
- handleRegisterClose: () => {
- dispatch(registerReset());
- },
- handleQueryToken: (key, query) => {
- dispatch(queryToken(key, query));
- },
- handleQueryClose: () => {
- dispatch(queryReset());
- }
- };
-};
-
-export default connect(
- mapStateToProps,
- mapDispatchToProps
-)(TokensContainer);
diff --git a/js/packages/dapp-tokenreg/Actions/index.js b/js/packages/dapp-tokenreg/Actions/index.js
deleted file mode 100644
index 070a6080e..000000000
--- a/js/packages/dapp-tokenreg/Actions/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './container.js';
diff --git a/js/packages/dapp-tokenreg/Actions/reducer.js b/js/packages/dapp-tokenreg/Actions/reducer.js
deleted file mode 100644
index e052ac027..000000000
--- a/js/packages/dapp-tokenreg/Actions/reducer.js
+++ /dev/null
@@ -1,155 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import {
- SET_REGISTER_SENDING,
- SET_REGISTER_ERROR,
- REGISTER_RESET,
- REGISTER_COMPLETED,
-
- SET_QUERY_LOADING,
- SET_QUERY_RESULT,
- SET_QUERY_NOT_FOUND,
- SET_QUERY_META_LOADING,
- SET_QUERY_META,
- QUERY_RESET
-} from './actions';
-
-const initialState = {
- register: {
- sending: false,
- error: null,
- complete: false
- },
- query: {
- loading: false,
- data: null,
- notFound: false,
- metaLoading: false,
- metaData: null
- }
-};
-
-export default (state = initialState, action) => {
- switch (action.type) {
- case SET_REGISTER_SENDING: {
- const registerState = state.register;
-
- return {
- ...state,
- register: {
- ...registerState,
- sending: action.isSending
- }
- };
- }
-
- case REGISTER_COMPLETED: {
- const registerState = state.register;
-
- return {
- ...state,
- register: {
- ...registerState,
- sending: false,
- complete: true
- }
- };
- }
-
- case SET_REGISTER_ERROR: {
- const registerState = state.register;
-
- return {
- ...state,
- register: {
- ...registerState,
- sending: false,
- error: action.error
- }
- };
- }
-
- case REGISTER_RESET: {
- return {
- ...state,
- register: initialState.register
- };
- }
-
- case SET_QUERY_LOADING: {
- return {
- ...state,
- query: {
- ...state.query,
- loading: action.isLoading
- }
- };
- }
-
- case SET_QUERY_RESULT: {
- return {
- ...state,
- query: {
- ...state.query,
- data: action.data
- }
- };
- }
-
- case SET_QUERY_NOT_FOUND: {
- return {
- ...state,
- query: {
- ...state.query,
- notFound: true
- }
- };
- }
-
- case SET_QUERY_META_LOADING: {
- return {
- ...state,
- query: {
- ...state.query,
- metaLoading: action.isLoading
- }
- };
- }
-
- case SET_QUERY_META: {
- return {
- ...state,
- query: {
- ...state.query,
- metaData: action.data
- }
- };
- }
-
- case QUERY_RESET: {
- return {
- ...state,
- query: {
- ...initialState.query
- }
- };
- }
-
- default:
- return state;
- }
-};
diff --git a/js/packages/dapp-tokenreg/Application/application.css b/js/packages/dapp-tokenreg/Application/application.css
deleted file mode 100644
index b1eef22e4..000000000
--- a/js/packages/dapp-tokenreg/Application/application.css
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.application {
- display: flex;
- flex-direction: column;
- align-items: center;
- padding-bottom: 10em;
-}
-
-.warning {
- background: #f80;
- bottom: 0;
- color: #fff;
- left: 0;
- opacity: 1;
- padding: 1.5em;
- position: fixed;
- right: 50%;
- z-index: 100;
-}
diff --git a/js/packages/dapp-tokenreg/Application/application.js b/js/packages/dapp-tokenreg/Application/application.js
deleted file mode 100644
index 97be87481..000000000
--- a/js/packages/dapp-tokenreg/Application/application.js
+++ /dev/null
@@ -1,78 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import getMuiTheme from 'material-ui/styles/getMuiTheme';
-import PropTypes from 'prop-types';
-
-import { api } from '../parity';
-
-import Loading from '../Loading';
-import Status from '../Status';
-import Tokens from '../Tokens';
-import Actions from '../Actions';
-
-import styles from './application.css';
-
-const muiTheme = getMuiTheme({
- palette: {
- primary1Color: '#27ae60'
- }
-});
-
-export default class Application extends Component {
- static childContextTypes = {
- muiTheme: PropTypes.object
- }
-
- static propTypes = {
- isLoading: PropTypes.bool.isRequired,
-
- contract: PropTypes.object
- };
-
- render () {
- const { isLoading, contract } = this.props;
-
- if (isLoading) {
- return (
-
- );
- }
-
- return (
-
-
-
-
-
-
-
- WARNING: The token registry is experimental. Please ensure that you understand the steps, risks, benefits & consequences of registering a token before doing so. A non-refundable fee of { api.util.fromWei(contract.fee).toFormat(3) }ETH is required for all registrations.
-
-
- );
- }
-
- getChildContext () {
- return {
- muiTheme
- };
- }
-}
diff --git a/js/packages/dapp-tokenreg/Application/index.js b/js/packages/dapp-tokenreg/Application/index.js
deleted file mode 100644
index 3d8d1ca3b..000000000
--- a/js/packages/dapp-tokenreg/Application/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './application';
diff --git a/js/packages/dapp-tokenreg/Chip/chip.css b/js/packages/dapp-tokenreg/Chip/chip.css
deleted file mode 100644
index 955d6809f..000000000
--- a/js/packages/dapp-tokenreg/Chip/chip.css
+++ /dev/null
@@ -1,45 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.chip > span {
- flex: 1;
- display: flex;
- flex-direction: row;
-}
-
-.chip img {
- margin-bottom: -11px;
- margin-left: -11px;
-}
-
-.value {
- font-family: 'Roboto Mono', monospace;
- color: rgba(255, 255, 255, 1);
- -webkit-user-select: text;
- cursor: text;
- flex: 1;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
-}
-
-.label {
- color: rgba(255, 255, 255, 0.7);
- margin-left: 1em;
- margin-right: 0.5em;
- text-transform: uppercase;
-}
diff --git a/js/packages/dapp-tokenreg/Chip/chip.js b/js/packages/dapp-tokenreg/Chip/chip.js
deleted file mode 100644
index 2d1c67d5b..000000000
--- a/js/packages/dapp-tokenreg/Chip/chip.js
+++ /dev/null
@@ -1,73 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-
-import { Chip } from 'material-ui';
-
-import IdentityIcon from '../IdentityIcon';
-
-import styles from './chip.css';
-
-export default class CustomChip extends Component {
- static propTypes = {
- value: PropTypes.string.isRequired,
- label: PropTypes.string.isRequired,
-
- isAddress: PropTypes.bool,
- displayValue: PropTypes.string
- };
-
- render () {
- const { isAddress, value, label } = this.props;
-
- const displayValue = this.props.displayValue || value;
-
- return (
-
- { this.renderIcon(isAddress, value) }
-
- { displayValue }
-
-
- { label }
-
-
- );
- }
-
- renderIcon (isAddress, address) {
- if (!isAddress) {
- return;
- }
-
- return (
-
- );
- }
-}
diff --git a/js/packages/dapp-tokenreg/Chip/index.js b/js/packages/dapp-tokenreg/Chip/index.js
deleted file mode 100644
index 2ce753c5f..000000000
--- a/js/packages/dapp-tokenreg/Chip/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './chip';
diff --git a/js/packages/dapp-tokenreg/Container.js b/js/packages/dapp-tokenreg/Container.js
deleted file mode 100644
index 066ed9797..000000000
--- a/js/packages/dapp-tokenreg/Container.js
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import { connect } from 'react-redux';
-import PropTypes from 'prop-types';
-
-import Application from './Application';
-
-import { loadContract } from './Status/actions';
-import { loadAccounts } from './Accounts/actions';
-
-class Container extends Component {
- static propTypes = {
- isLoading: PropTypes.bool.isRequired,
- contract: PropTypes.object.isRequired,
- onLoad: PropTypes.func.isRequired
- };
-
- componentDidMount () {
- this.props.onLoad();
- }
-
- render () {
- const { isLoading, contract } = this.props;
-
- return (
-
- );
- }
-}
-
-const mapStateToProps = (state) => {
- const { isLoading, contract } = state.status;
-
- return {
- isLoading,
- contract
- };
-};
-
-const mapDispatchToProps = (dispatch) => {
- return {
- onLoad: () => {
- dispatch(loadContract());
- dispatch(loadAccounts());
- }
- };
-};
-
-export default connect(mapStateToProps, mapDispatchToProps)(Container);
diff --git a/js/packages/dapp-tokenreg/IdentityIcon/identityIcon.css b/js/packages/dapp-tokenreg/IdentityIcon/identityIcon.css
deleted file mode 100644
index 7f748da52..000000000
--- a/js/packages/dapp-tokenreg/IdentityIcon/identityIcon.css
+++ /dev/null
@@ -1,23 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.icon {
- width: 32px;
- height: 32px;
- border-radius: 50%;
- margin-right: 0.5em;
-}
diff --git a/js/packages/dapp-tokenreg/IdentityIcon/identityIcon.js b/js/packages/dapp-tokenreg/IdentityIcon/identityIcon.js
deleted file mode 100644
index 04d29a5bc..000000000
--- a/js/packages/dapp-tokenreg/IdentityIcon/identityIcon.js
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-
-import { api } from '../parity';
-import styles from './identityIcon.css';
-
-export default class IdentityIcon extends Component {
- static propTypes = {
- address: PropTypes.string.isRequired
- }
-
- render () {
- const { address } = this.props;
-
- return (
-
- );
- }
-}
diff --git a/js/packages/dapp-tokenreg/IdentityIcon/index.js b/js/packages/dapp-tokenreg/IdentityIcon/index.js
deleted file mode 100644
index 091913564..000000000
--- a/js/packages/dapp-tokenreg/IdentityIcon/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './identityIcon';
diff --git a/js/packages/dapp-tokenreg/Inputs/Text/container.js b/js/packages/dapp-tokenreg/Inputs/Text/container.js
deleted file mode 100644
index 43ec03939..000000000
--- a/js/packages/dapp-tokenreg/Inputs/Text/container.js
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import { connect } from 'react-redux';
-
-import InputText from './input-text';
-
-class InputTextContainer extends Component {
- render () {
- return (
-
- );
- }
-}
-
-const mapStateToProps = (state) => {
- const { contract } = state.status;
-
- return { contract };
-};
-
-export default connect(mapStateToProps)(InputTextContainer);
diff --git a/js/packages/dapp-tokenreg/Inputs/Text/index.js b/js/packages/dapp-tokenreg/Inputs/Text/index.js
deleted file mode 100644
index 0deedaecc..000000000
--- a/js/packages/dapp-tokenreg/Inputs/Text/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './container';
diff --git a/js/packages/dapp-tokenreg/Inputs/Text/input-text.js b/js/packages/dapp-tokenreg/Inputs/Text/input-text.js
deleted file mode 100644
index ade2c9520..000000000
--- a/js/packages/dapp-tokenreg/Inputs/Text/input-text.js
+++ /dev/null
@@ -1,150 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-
-import { TextField } from 'material-ui';
-import CheckIcon from 'material-ui/svg-icons/navigation/check';
-import { green500 } from 'material-ui/styles/colors';
-
-import Loading from '../../Loading';
-
-import { validate } from '../validation';
-
-import styles from '../inputs.css';
-
-const initState = {
- error: null,
- value: '',
- valid: false,
- disabled: false,
- loading: false
-};
-
-export default class InputText extends Component {
- static propTypes = {
- validationType: PropTypes.string.isRequired,
- onChange: PropTypes.func.isRequired,
- onEnter: PropTypes.func,
-
- floatingLabelText: PropTypes.string,
- hintText: PropTypes.string,
-
- contract: PropTypes.object
- }
-
- state = initState;
-
- render () {
- const { disabled, error } = this.state;
-
- return (
-
- );
- }
-
- onChange = (event) => {
- const value = event.target.value;
-
- // So we can focus on the input after async validation
- event.persist();
-
- const { validationType, contract } = this.props;
- const validation = validate(value, validationType, contract);
-
- const loadingTimeout = setTimeout(() => {
- this.setState({ disabled: true, loading: true });
- }, 50);
-
- return Promise.resolve(validation)
- .then((validation) => {
- clearTimeout(loadingTimeout);
-
- this.setValidation({
- ...validation,
- disabled: false,
- loading: false
- });
-
- event.target.focus();
- });
- }
-
- onKeyDown = (event) => {
- if (!this.props.onEnter) {
- return;
- }
-
- if (event.keyCode !== 13) {
- return;
- }
-
- this.props.onEnter();
- }
-
- setValidation = (validation) => {
- const { value } = validation;
-
- this.setState({ ...validation });
-
- if (validation.valid) {
- return this.props.onChange(true, value);
- }
-
- return this.props.onChange(false, value);
- }
-}
diff --git a/js/packages/dapp-tokenreg/Inputs/inputs.css b/js/packages/dapp-tokenreg/Inputs/inputs.css
deleted file mode 100644
index 6aefe90e3..000000000
--- a/js/packages/dapp-tokenreg/Inputs/inputs.css
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.input-container {
- width: 100%;
- position: relative;
-}
-
-.input-loading {
- position: absolute;
- right: -5px;
- top: 20px;
-}
-
-.input-icon {
- position: absolute;
- right: 5px;
- bottom: 10px;
-}
diff --git a/js/packages/dapp-tokenreg/Inputs/validation.js b/js/packages/dapp-tokenreg/Inputs/validation.js
deleted file mode 100644
index 73b9ab0ec..000000000
--- a/js/packages/dapp-tokenreg/Inputs/validation.js
+++ /dev/null
@@ -1,253 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import validator from 'validator';
-
-import { api } from '../parity';
-
-import { getTokenTotalSupply } from '../utils';
-
-const {
- isHex,
- isAddressValid,
- toChecksumAddress
-} = api.util;
-
-export const ADDRESS_TYPE = 'ADDRESS_TYPE';
-export const TOKEN_ADDRESS_TYPE = 'TOKEN_ADDRESS_TYPE';
-export const SIMPLE_TOKEN_ADDRESS_TYPE = 'SIMPLE_TOKEN_ADDRESS_TYPE';
-export const TLA_TYPE = 'TLA_TYPE';
-export const SIMPLE_TLA_TYPE = 'SIMPLE_TLA_TYPE';
-export const UINT_TYPE = 'UINT_TYPE';
-export const DECIMAL_TYPE = 'DECIMAL_TYPE';
-export const STRING_TYPE = 'STRING_TYPE';
-export const HEX_TYPE = 'HEX_TYPE';
-export const URL_TYPE = 'URL_TYPE';
-
-export const ERRORS = {
- invalidTLA: 'The TLA should be 3 characters long',
- invalidUint: 'Please enter a non-negative integer',
- invalidDecimal: 'Please enter a value between 0 and 18',
- invalidString: 'Please enter at least a character',
- invalidAccount: 'Please select an account to transact with',
- invalidRecipient: 'Please select an account to send to',
- invalidAddress: 'The address is not in the correct format',
- invalidTokenAddress: 'The address is not a regular token contract address',
- invalidHex: 'Please enter an hexadecimal string (digits and letters from a to z)',
- invalidAmount: 'Please enter a positive amount > 0',
- invalidTotal: 'The amount is greater than the availale balance',
- tlaAlreadyTaken: 'This TLA address is already registered',
- addressAlreadyTaken: 'This Token address is already registered',
- invalidURL: 'Please enter a valid URL'
-};
-
-const validateAddress = (address) => {
- if (!isAddressValid(address)) {
- return {
- error: ERRORS.invalidAddress,
- valid: false
- };
- }
-
- return {
- value: toChecksumAddress(address),
- error: null,
- valid: true
- };
-};
-
-const validateTokenAddress = (address, contract, simple) => {
- const addressValidation = validateAddress(address);
-
- if (!addressValidation.valid) {
- return addressValidation;
- }
-
- if (simple) {
- return addressValidation;
- }
-
- return getTokenTotalSupply(address)
- .then(balance => {
- if (balance === null || balance.equals(0)) {
- return {
- error: ERRORS.invalidTokenAddress,
- valid: false
- };
- }
-
- return contract.instance
- .fromAddress.call({}, [ address ])
- .then(([id, tla, base, name, owner]) => {
- if (owner !== '0x0000000000000000000000000000000000000000') {
- return {
- error: ERRORS.addressAlreadyTaken,
- valid: false
- };
- }
- });
- })
- .then((result) => {
- if (result) {
- return result;
- }
-
- return addressValidation;
- });
-};
-
-const validateTLA = (tla, contract, simple) => {
- if (tla.toString().length !== 3) {
- return {
- error: ERRORS.invalidTLA,
- valid: false
- };
- }
-
- const fTLA = tla.toString().toUpperCase();
-
- if (simple) {
- return {
- value: fTLA,
- error: null,
- valid: true
- };
- }
-
- return contract.instance
- .fromTLA.call({}, [ fTLA ])
- .then(([id, address, base, name, owner]) => {
- if (owner !== '0x0000000000000000000000000000000000000000') {
- return {
- error: ERRORS.tlaAlreadyTaken,
- valid: false
- };
- }
- })
- .then((result) => {
- if (result) {
- return result;
- }
-
- return {
- value: fTLA,
- error: null,
- valid: true
- };
- });
-};
-
-const validateUint = (uint) => {
- if (!/^\d+$/.test(uint) || parseInt(uint) <= 0) {
- return {
- error: ERRORS.invalidUint,
- valid: false
- };
- }
-
- return {
- value: parseInt(uint),
- error: null,
- valid: true
- };
-};
-
-const validateDecimal = (decimal) => {
- if (!/^\d+$/.test(decimal) || parseInt(decimal) < 0 || parseInt(decimal) > 18) {
- return {
- error: ERRORS.invalidDecimal,
- valid: false
- };
- }
-
- return {
- value: parseInt(decimal),
- error: null,
- valid: true
- };
-};
-
-const validateString = (string) => {
- if (string.toString().length === 0) {
- return {
- error: ERRORS.invalidString,
- valid: false
- };
- }
-
- return {
- value: string.toString(),
- error: null,
- valid: true
- };
-};
-
-const validateHex = (string) => {
- if (!isHex(string.toString())) {
- return {
- error: ERRORS.invalidHex,
- valid: false
- };
- }
-
- return {
- value: string.toString(),
- error: null,
- valid: true
- };
-};
-
-const validateURL = (string) => {
- if (!validator.isURL(string.toString())) {
- return {
- error: ERRORS.invalidURL,
- valid: false
- };
- }
-
- return {
- value: string.toString(),
- error: null,
- valid: true
- };
-};
-
-export const validate = (value, type, contract) => {
- switch (type) {
- case ADDRESS_TYPE:
- return validateAddress(value);
- case TOKEN_ADDRESS_TYPE:
- return validateTokenAddress(value, contract);
- case SIMPLE_TOKEN_ADDRESS_TYPE:
- return validateTokenAddress(value, contract, true);
- case TLA_TYPE:
- return validateTLA(value, contract);
- case SIMPLE_TLA_TYPE:
- return validateTLA(value, contract, true);
- case UINT_TYPE:
- return validateUint(value);
- case DECIMAL_TYPE:
- return validateDecimal(value);
- case STRING_TYPE:
- return validateString(value);
- case HEX_TYPE:
- return validateHex(value);
- case URL_TYPE:
- return validateURL(value);
- default:
- return { valid: true, error: null };
- }
-};
diff --git a/js/packages/dapp-tokenreg/Loading/index.js b/js/packages/dapp-tokenreg/Loading/index.js
deleted file mode 100644
index 5eb10a7d4..000000000
--- a/js/packages/dapp-tokenreg/Loading/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './loading';
diff --git a/js/packages/dapp-tokenreg/Loading/loading.css b/js/packages/dapp-tokenreg/Loading/loading.css
deleted file mode 100644
index dd9e392e1..000000000
--- a/js/packages/dapp-tokenreg/Loading/loading.css
+++ /dev/null
@@ -1,23 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.loading {
- flex: 1;
- display: flex;
- align-items: center;
- justify-content: center;
-}
diff --git a/js/packages/dapp-tokenreg/Loading/loading.js b/js/packages/dapp-tokenreg/Loading/loading.js
deleted file mode 100644
index 5c33de17b..000000000
--- a/js/packages/dapp-tokenreg/Loading/loading.js
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import CircularProgress from 'material-ui/CircularProgress';
-import PropTypes from 'prop-types';
-
-import styles from './loading.css';
-
-export default class Loading extends Component {
- static propTypes = {
- size: PropTypes.number
- };
-
- render () {
- const size = (this.props.size || 2) * 60;
-
- return (
-
-
-
- );
- }
-}
diff --git a/js/packages/dapp-tokenreg/Status/actions.js b/js/packages/dapp-tokenreg/Status/actions.js
deleted file mode 100644
index 22c99a5b5..000000000
--- a/js/packages/dapp-tokenreg/Status/actions.js
+++ /dev/null
@@ -1,185 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import Contracts from '@parity/shared/contracts';
-
-import { loadToken, setTokenPending, deleteToken, setTokenData } from '../Tokens/actions';
-import { api } from '../parity';
-
-export const SET_LOADING = 'SET_LOADING';
-export const setLoading = (isLoading) => ({
- type: SET_LOADING,
- isLoading
-});
-
-export const FIND_CONTRACT = 'FIND_CONTRACT';
-export const loadContract = () => (dispatch) => {
- dispatch(setLoading(true));
-
- const { tokenReg, githubHint } = new Contracts(api);
-
- return Promise
- .all([
- tokenReg.getContract(),
- githubHint.getContract()
- ])
- .then(([ tokenRegContract, githubHintContract ]) => {
- dispatch(setContractDetails({
- address: tokenRegContract.address,
- instance: tokenRegContract.instance,
- raw: tokenRegContract
- }));
-
- dispatch(setGithubhintDetails({
- address: githubHintContract.address,
- instance: githubHintContract.instance,
- raw: githubHintContract
- }));
-
- dispatch(loadContractDetails());
- dispatch(subscribeEvents());
- })
- .catch((error) => {
- throw error;
- });
-};
-
-export const LOAD_CONTRACT_DETAILS = 'LOAD_CONTRACT_DETAILS';
-export const loadContractDetails = () => (dispatch, getState) => {
- const state = getState();
-
- const { instance } = state.status.contract;
-
- Promise
- .all([
- api.eth.accounts(),
- instance.owner.call(),
- instance.fee.call()
- ])
- .then(([accounts, owner, fee]) => {
- const isOwner = accounts.filter(a => a === owner).length > 0;
-
- dispatch(setContractDetails({
- fee,
- owner,
- isOwner
- }));
-
- dispatch(setLoading(false));
- })
- .catch((error) => {
- console.error('loadContractDetails error', error);
- });
-};
-
-export const SET_CONTRACT_DETAILS = 'SET_CONTRACT_DETAILS';
-export const setContractDetails = (details) => ({
- type: SET_CONTRACT_DETAILS,
- details
-});
-
-export const SET_GITHUBHINT_CONTRACT = 'SET_GITHUBHINT_CONTRACT';
-export const setGithubhintDetails = (details) => ({
- type: SET_GITHUBHINT_CONTRACT,
- details
-});
-
-export const subscribeEvents = () => (dispatch, getState) => {
- const state = getState();
-
- const { raw } = state.status.contract;
- const previousSubscriptionId = state.status.subscriptionId;
-
- if (previousSubscriptionId) {
- raw.unsubscribe(previousSubscriptionId);
- }
-
- raw
- .subscribe(null, {
- fromBlock: 'latest',
- toBlock: 'pending',
- limit: 50
- }, (error, logs) => {
- if (error) {
- console.error('setupFilters', error);
- return;
- }
-
- if (!logs || logs.length === 0) {
- return;
- }
-
- logs.forEach(log => {
- const event = log.event;
- const type = log.type;
- const params = log.params;
-
- if (event === 'Registered' && type === 'pending') {
- return dispatch(setTokenData(params.id.value.toNumber(), {
- tla: '...',
- base: -1,
- address: params.addr.value,
- name: params.name.value,
- isPending: true
- }));
- }
-
- if (event === 'Registered' && type === 'mined') {
- return dispatch(loadToken(params.id.value.toNumber()));
- }
-
- if (event === 'Unregistered' && type === 'pending') {
- return dispatch(setTokenPending(params.id.value.toNumber(), true));
- }
-
- if (event === 'Unregistered' && type === 'mined') {
- return dispatch(deleteToken(params.id.value.toNumber()));
- }
-
- if (event === 'MetaChanged' && type === 'pending') {
- return dispatch(setTokenData(
- params.id.value.toNumber(),
- { metaPending: true, metaMined: false }
- ));
- }
-
- if (event === 'MetaChanged' && type === 'mined') {
- setTimeout(() => {
- dispatch(setTokenData(
- params.id.value.toNumber(),
- { metaPending: false, metaMined: false }
- ));
- }, 5000);
-
- return dispatch(setTokenData(
- params.id.value.toNumber(),
- { metaPending: false, metaMined: true }
- ));
- }
-
- console.warn('unknown log event', log);
- });
- })
- .then((subscriptionId) => {
- dispatch(setSubscriptionId(subscriptionId));
- });
-};
-
-export const SET_SUBSCRIPTION_ID = 'SET_SUBSCRIPTION_ID';
-export const setSubscriptionId = subscriptionId => ({
- type: SET_SUBSCRIPTION_ID,
- subscriptionId
-});
diff --git a/js/packages/dapp-tokenreg/Status/index.js b/js/packages/dapp-tokenreg/Status/index.js
deleted file mode 100644
index b41557c1c..000000000
--- a/js/packages/dapp-tokenreg/Status/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './status';
diff --git a/js/packages/dapp-tokenreg/Status/reducer.js b/js/packages/dapp-tokenreg/Status/reducer.js
deleted file mode 100644
index e3bcd85b5..000000000
--- a/js/packages/dapp-tokenreg/Status/reducer.js
+++ /dev/null
@@ -1,63 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import {
- SET_LOADING,
- SET_CONTRACT_DETAILS,
- SET_GITHUBHINT_CONTRACT,
- SET_SUBSCRIPTION_ID
-} from './actions';
-
-const initialState = {
- isLoading: true,
- subscriptionId: null,
- contract: {
- address: null,
- instance: null,
- owner: null,
- isOwner: false,
- fee: null
- },
- githubhint: {
- address: null,
- instance: null
- }
-};
-
-export default (state = initialState, action) => {
- switch (action.type) {
- case SET_LOADING:
- return { ...state, isLoading: action.isLoading };
-
- case SET_SUBSCRIPTION_ID:
- return { ...state, subscriptionId: action.subscriptionId };
-
- case SET_CONTRACT_DETAILS:
- return { ...state, contract: {
- ...state.contract,
- ...action.details
- } };
-
- case SET_GITHUBHINT_CONTRACT:
- return { ...state, githubhint: {
- ...state.githubhint,
- ...action.details
- } };
-
- default:
- return state;
- }
-};
diff --git a/js/packages/dapp-tokenreg/Status/status.css b/js/packages/dapp-tokenreg/Status/status.css
deleted file mode 100644
index 1f277ea79..000000000
--- a/js/packages/dapp-tokenreg/Status/status.css
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.status {
- background: rgba(46, 204, 113, 0.85);
- color: rgba(255, 255, 255, 1);
- padding: 4em 0 2em 0;
-
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
-
- width: 100%;
-}
-
-.title {
- font-size: 3rem;
- font-weight: 300;
- margin: 0;
- text-transform: uppercase;
-}
-
-.byline {
- font-size: 1.25em;
- opacity: 0.75;
- margin: 0 0 1.75em 0;
-}
diff --git a/js/packages/dapp-tokenreg/Status/status.js b/js/packages/dapp-tokenreg/Status/status.js
deleted file mode 100644
index 17ed9a76f..000000000
--- a/js/packages/dapp-tokenreg/Status/status.js
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-
-import { api } from '../parity';
-import Chip from '../Chip';
-
-import styles from './status.css';
-
-export default class Status extends Component {
- static propTypes = {
- address: PropTypes.string.isRequired,
- fee: PropTypes.object.isRequired
- };
-
- render () {
- const { fee } = this.props;
-
- return (
-
-
Token Registry
-
A global registry of all recognised tokens on the network
-
-
- );
- }
-}
diff --git a/js/packages/dapp-tokenreg/Tokens/Token/add-meta.js b/js/packages/dapp-tokenreg/Tokens/Token/add-meta.js
deleted file mode 100644
index 488893c04..000000000
--- a/js/packages/dapp-tokenreg/Tokens/Token/add-meta.js
+++ /dev/null
@@ -1,228 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import { Dialog, RaisedButton, FlatButton, SelectField, MenuItem } from 'material-ui';
-import AddIcon from 'material-ui/svg-icons/content/add';
-import PropTypes from 'prop-types';
-
-import InputText from '../../Inputs/Text';
-import { ADDRESS_TYPE, URL_TYPE } from '../../Inputs/validation';
-
-import styles from './token.css';
-
-import { metaDataKeys } from '../../constants';
-
-const initState = {
- showDialog: false,
- complete: false,
- metaKeyIndex: 0,
-
- form: {
- valid: false,
- value: ''
- }
-};
-
-export default class AddMeta extends Component {
- static propTypes = {
- isTokenOwner: PropTypes.bool,
- handleAddMeta: PropTypes.func,
- index: PropTypes.number
- };
-
- state = initState;
-
- render () {
- if (!this.props.isTokenOwner) {
- return null;
- }
-
- return (
- );
- }
-
- renderMetaKeyItems () {
- return metaDataKeys.map((key, index) => (
-
- ));
- }
-
- onShowDialog = () => {
- this.setState({ showDialog: true });
- }
-
- onClose = () => {
- this.setState(initState);
- }
-
- onAdd = () => {
- const { index } = this.props;
- const { form, metaKeyIndex } = this.state;
-
- const selectedMeta = metaDataKeys[metaKeyIndex];
-
- const keyIndex = this.state.metaKeyIndex;
- const key = metaDataKeys[keyIndex].value;
- const value = form.value;
- const validationType = selectedMeta.validation;
-
- this.props.handleAddMeta(
- index,
- key,
- value,
- validationType
- );
-
- this.setState({ complete: true });
- }
-
- onChange = (valid, value) => {
- this.setState({
- form: {
- valid, value
- }
- });
- }
-
- onMetaKeyChange = (event, metaKeyIndex) => {
- this.setState({ metaKeyIndex, form: {
- ...[this.state.form],
- valid: false,
- value: ''
- } });
- }
-}
diff --git a/js/packages/dapp-tokenreg/Tokens/Token/index.js b/js/packages/dapp-tokenreg/Tokens/Token/index.js
deleted file mode 100644
index 7c1ac356a..000000000
--- a/js/packages/dapp-tokenreg/Tokens/Token/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './tokenContainer';
diff --git a/js/packages/dapp-tokenreg/Tokens/Token/token.css b/js/packages/dapp-tokenreg/Tokens/Token/token.css
deleted file mode 100644
index 990a16fba..000000000
--- a/js/packages/dapp-tokenreg/Tokens/Token/token.css
+++ /dev/null
@@ -1,140 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.token{
- position: relative;
- display: flex;
-
- width: 20rem;
- margin: 1rem;
- padding: 1rem;
- padding-bottom: 1.5rem;
-}
-
-.token-container, .token-content, .token-meta {
- width: 100%;
-
- display: flex;
- flex-direction: column;
- align-items: center;
-}
-
-.token-content, .token-meta {
- z-index: 50;
-}
-
-.token-bg {
- position: absolute;
- top: 0;
- bottom: 0;
- right: 0;
- left: 0;
- -webkit-filter: blur(5px);
- filter: blur(5px);
- background-color: rgba(255, 255, 255, 0.85);
-}
-
-.token-container {
- flex: 1 1 auto;
-}
-
-.full-width .token-container {
- flex-direction: row;
- align-items: flex-start;
-}
-
-.full-width .token-content {
- width: 20rem;
- margin-right: 1rem;
-}
-
-.token-content > div, .token-meta > div {
- max-width: 100%;
-}
-
-.loading {
- margin: 1rem 0;
-}
-
-.name {
- padding-bottom: 0.75rem;
-}
-
-.title {
- font-size: 2rem;
- padding: 0 0 0.5rem;
-}
-
-.meta-query {
- font-size: 0.9rem;
- margin-top: 1.5rem;
- margin-bottom: 0;
-}
-
-.meta-key {
- font-weight: bold;
-}
-
-.meta-value {
- margin-top: 0.5rem;
- max-width: 100%;
- overflow-wrap: break-word;
-}
-
-.meta-info {
- margin-top: 1.5rem;
- margin-bottom: -0.5rem;
- font-size: 0.9rem;
- color: gray;
-}
-
-.meta-image {
- width: 100%;
- margin-top: 1rem;
-}
-
-.meta-image img {
- width: 100%;
-}
-
-.meta-form {
- width: 100%;
-}
-
-.unregister {
- margin-top: 1rem;
-}
-
-.add-meta {
- margin-top: 1rem;
- width: 100%;
-}
-
-.pending {
- position: absolute;
- top: 0;
- bottom: 0;
- right: 0;
- left: 0;
- z-index: 100;
- background-color: rgba(0, 0, 0, 0.35);
-}
-
-.dialog h3 {
- color: rgba(50, 100, 150, 1) !important;
- text-transform: uppercase;
-}
diff --git a/js/packages/dapp-tokenreg/Tokens/Token/token.js b/js/packages/dapp-tokenreg/Tokens/Token/token.js
deleted file mode 100644
index 4178f2f64..000000000
--- a/js/packages/dapp-tokenreg/Tokens/Token/token.js
+++ /dev/null
@@ -1,400 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import Paper from 'material-ui/Paper';
-import { RaisedButton, SelectField, MenuItem } from 'material-ui';
-import PropTypes from 'prop-types';
-
-import FindIcon from 'material-ui/svg-icons/action/find-in-page';
-import DeleteIcon from 'material-ui/svg-icons/action/delete';
-
-import Loading from '../../Loading';
-import Chip from '../../Chip';
-import AddMeta from './add-meta';
-
-import styles from './token.css';
-
-import { metaDataKeys } from '../../constants';
-
-import { api } from '../../parity';
-
-export default class Token extends Component {
- static propTypes = {
- handleMetaLookup: PropTypes.func.isRequired,
- address: PropTypes.string.isRequired,
- name: PropTypes.string.isRequired,
- index: PropTypes.number.isRequired,
- owner: PropTypes.string.isRequired,
-
- handleAddMeta: PropTypes.func,
- handleUnregister: PropTypes.func,
-
- tla: PropTypes.string,
- base: PropTypes.number,
- totalSupply: PropTypes.number,
- meta: PropTypes.object,
- isMetaLoading: PropTypes.bool,
- ownerAccountInfo: PropTypes.shape({
- name: PropTypes.string,
- meta: PropTypes.object
- }),
- metaPending: PropTypes.bool,
- metaMined: PropTypes.bool,
- isLoading: PropTypes.bool,
- isPending: PropTypes.bool,
- isTokenOwner: PropTypes.bool.isRequired,
- isContractOwner: PropTypes.bool,
-
- fullWidth: PropTypes.bool
- };
-
- static defaultProps = {
- isContractOwner: false
- };
-
- state = {
- metaKeyIndex: 0,
- showMeta: false
- };
-
- shouldComponentUpdate (nextProps) {
- if (nextProps.isLoading && this.props.isLoading) {
- return false;
- }
-
- return true;
- }
-
- render () {
- const { isLoading, fullWidth } = this.props;
-
- if (isLoading) {
- return (
-
- );
- }
-
- onUnregister = () => {
- const index = this.props.index;
-
- this.props.handleUnregister(index);
- }
-
- onMetaLookup = () => {
- const keyIndex = this.state.metaKeyIndex;
- const key = metaDataKeys[keyIndex].value;
- const index = this.props.index;
-
- this.setState({ showMeta: true });
- this.props.handleMetaLookup(index, key);
- }
-
- onMetaKeyChange = (event, metaKeyIndex) => {
- this.setState({ metaKeyIndex });
- }
-}
diff --git a/js/packages/dapp-tokenreg/Tokens/Token/tokenContainer.js b/js/packages/dapp-tokenreg/Tokens/Token/tokenContainer.js
deleted file mode 100644
index f5acf350b..000000000
--- a/js/packages/dapp-tokenreg/Tokens/Token/tokenContainer.js
+++ /dev/null
@@ -1,74 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import { connect } from 'react-redux';
-import PropTypes from 'prop-types';
-
-import Token from './token';
-
-import { queryTokenMeta, unregisterToken, addTokenMeta } from '../actions';
-
-class TokenContainer extends Component {
- static propTypes = {
- handleMetaLookup: PropTypes.func.isRequired,
- handleUnregister: PropTypes.func.isRequired,
- handleAddMeta: PropTypes.func.isRequired,
-
- tla: PropTypes.string.isRequired
- };
-
- render () {
- return (
-
- );
- }
-}
-
-const mapStateToProps = (_, initProps) => {
- const { tla } = initProps;
-
- return (state) => {
- const { isOwner } = state.status.contract;
- const { tokens } = state.tokens;
- const token = tokens.find((t) => t.tla === tla);
-
- return { ...token, isContractOwner: isOwner };
- };
-};
-
-const mapDispatchToProps = (dispatch) => {
- return {
- handleMetaLookup: (index, query) => {
- dispatch(queryTokenMeta(index, query));
- },
-
- handleUnregister: (index) => {
- dispatch(unregisterToken(index));
- },
-
- handleAddMeta: (index, key, value, validationType) => {
- dispatch(addTokenMeta(index, key, value, validationType));
- }
- };
-};
-
-export default connect(
- mapStateToProps,
- mapDispatchToProps
-)(TokenContainer);
diff --git a/js/packages/dapp-tokenreg/Tokens/actions.js b/js/packages/dapp-tokenreg/Tokens/actions.js
deleted file mode 100644
index 57581e651..000000000
--- a/js/packages/dapp-tokenreg/Tokens/actions.js
+++ /dev/null
@@ -1,261 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { URL_TYPE } from '../Inputs/validation';
-import { getTokenTotalSupply, urlToHash } from '../utils';
-import { api } from '../parity';
-
-const { bytesToHex } = api.util;
-
-export const SET_TOKENS_LOADING = 'SET_TOKENS_LOADING';
-export const setTokensLoading = (isLoading) => ({
- type: SET_TOKENS_LOADING,
- isLoading
-});
-
-export const SET_TOKEN_COUNT = 'SET_TOKEN_COUNT';
-export const setTokenCount = (tokenCount) => ({
- type: SET_TOKEN_COUNT,
- tokenCount
-});
-
-export const SET_TOKEN_DATA = 'SET_TOKEN_DATA';
-export const setTokenData = (index, tokenData) => ({
- type: SET_TOKEN_DATA,
- index, tokenData
-});
-
-export const SET_TOKEN_META = 'SET_TOKEN_META';
-export const setTokenMeta = (index, meta) => ({
- type: SET_TOKEN_META,
- index, meta
-});
-
-export const SET_TOKEN_LOADING = 'SET_TOKEN_LOADING';
-export const setTokenLoading = (index, isLoading) => ({
- type: SET_TOKEN_LOADING,
- index, isLoading
-});
-
-export const SET_TOKEN_META_LOADING = 'SET_TOKEN_META_LOADING';
-export const setTokenMetaLoading = (index, isMetaLoading) => ({
- type: SET_TOKEN_META_LOADING,
- index, isMetaLoading
-});
-
-export const SET_TOKEN_PENDING = 'SET_TOKEN_PENDING';
-export const setTokenPending = (index, isPending) => ({
- type: SET_TOKEN_PENDING,
- index, isPending
-});
-
-export const DELETE_TOKEN = 'DELETE_TOKEN';
-export const deleteToken = (index) => ({
- type: DELETE_TOKEN,
- index
-});
-
-export const loadTokens = () => (dispatch, getState) => {
- const state = getState();
- const contractInstance = state.status.contract.instance;
-
- dispatch(setTokensLoading(true));
-
- contractInstance
- .tokenCount
- .call()
- .then((count) => {
- const tokenCount = parseInt(count);
-
- dispatch(setTokenCount(tokenCount));
-
- for (let i = 0; i < tokenCount; i++) {
- dispatch(loadToken(i));
- }
-
- dispatch(setTokensLoading(false));
- })
- .catch((e) => {
- console.error('loadTokens error', e);
- });
-};
-
-export const loadToken = (index) => (dispatch, getState) => {
- const state = getState();
- const contractInstance = state.status.contract.instance;
- const userAccounts = state.accounts.list;
- const accountsInfo = state.accounts.accountsInfo;
-
- dispatch(setTokenLoading(index, true));
-
- contractInstance
- .token
- .call({}, [ parseInt(index) ])
- .then((result) => {
- const tokenOwner = result[4];
- const isTokenOwner = userAccounts
- .filter(a => a.address === tokenOwner)
- .length > 0;
- const data = {
- index: parseInt(index),
- address: result[0],
- tla: result[1],
- base: result[2].toNumber(),
- name: result[3],
- owner: tokenOwner,
- ownerAccountInfo: accountsInfo[tokenOwner],
- isPending: false,
- isTokenOwner
- };
-
- return data;
- })
- .then(data => {
- return getTokenTotalSupply(data.address)
- .then(totalSupply => {
- data.totalSupply = totalSupply;
- return data;
- });
- })
- .then(data => {
- // If no total supply, must not be a proper token
- if (data.totalSupply === null) {
- dispatch(setTokenData(index, null));
- dispatch(setTokenLoading(index, false));
- return;
- }
-
- data.totalSupply = data.totalSupply.toNumber();
-
- dispatch(setTokenData(index, data));
- dispatch(setTokenLoading(index, false));
- })
- .catch((e) => {
- dispatch(setTokenData(index, null));
- dispatch(setTokenLoading(index, false));
-
- if (!(e instanceof TypeError)) {
- console.error(`loadToken #${index} error`, e);
- }
- });
-};
-
-export const queryTokenMeta = (index, query) => (dispatch, getState) => {
- const state = getState();
- const contractInstance = state.status.contract.instance;
- const startDate = Date.now();
-
- dispatch(setTokenMetaLoading(index, true));
-
- contractInstance
- .meta
- .call({}, [ index, query ])
- .then((value) => {
- const meta = {
- query,
- value: value.find(v => v !== 0) ? bytesToHex(value) : null
- };
-
- dispatch(setTokenMeta(index, meta));
-
- setTimeout(() => {
- dispatch(setTokenMetaLoading(index, false));
- }, 500 - (Date.now() - startDate));
- })
- .catch((e) => {
- console.error(`loadToken #${index} error`, e);
- });
-};
-
-export const addTokenMeta = (index, key, value, validationType) => (dispatch, getState) => {
- const state = getState();
-
- const contractInstance = state.status.contract.instance;
- const ghhInstance = state.status.githubhint.instance;
-
- const token = state.tokens.tokens.find(t => t.index === index);
- const options = { from: token.owner };
- let valuesPromise;
-
- // Get the right values (could be a hashed URL from GHH)
- if (validationType === URL_TYPE) {
- valuesPromise = addGithubhintURL(ghhInstance, options, value)
- .then((hash) => [ index, key, hash ]);
- } else {
- valuesPromise = Promise.resolve([ index, key, value ]);
- }
-
- return valuesPromise
- .then((values) => {
- return contractInstance
- .setMeta
- .estimateGas(options, values)
- .then((gasEstimate) => {
- options.gas = gasEstimate.mul(1.2).toFixed(0);
- return contractInstance.setMeta.postTransaction(options, values);
- });
- })
- .catch((e) => {
- console.error(`addTokenMeta: #${index} error`, e);
- });
-};
-
-export const addGithubhintURL = (ghhInstance, _options, url) => {
- return urlToHash(ghhInstance, url)
- .then((result) => {
- const { hash, registered } = result;
-
- if (registered) {
- return hash;
- }
-
- const options = { from: _options.from };
- const values = [ hash, url ];
-
- ghhInstance
- .hintURL
- .estimateGas(options, values)
- .then((gasEstimate) => {
- options.gas = gasEstimate.mul(1.2).toFixed(0);
- return ghhInstance.hintURL.postTransaction(options, values);
- })
- .catch((error) => {
- console.error(`registering "${url}" to GHH`, error);
- });
-
- return hash;
- });
-};
-
-export const unregisterToken = (index) => (dispatch, getState) => {
- const { contract } = getState().status;
- const { instance, owner } = contract;
- const values = [ index ];
- const options = {
- from: owner
- };
-
- instance
- .unregister
- .estimateGas(options, values)
- .then((gasEstimate) => {
- options.gas = gasEstimate.mul(1.2).toFixed(0);
- return instance.unregister.postTransaction(options, values);
- })
- .catch((e) => {
- console.error(`unregisterToken #${index} error`, e);
- });
-};
diff --git a/js/packages/dapp-tokenreg/Tokens/container.js b/js/packages/dapp-tokenreg/Tokens/container.js
deleted file mode 100644
index 9920c74df..000000000
--- a/js/packages/dapp-tokenreg/Tokens/container.js
+++ /dev/null
@@ -1,66 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import { connect } from 'react-redux';
-import PropTypes from 'prop-types';
-
-import Tokens from './tokens';
-
-import { loadTokens } from './actions';
-
-class TokensContainer extends Component {
- static propTypes = {
- isLoading: PropTypes.bool,
- tokens: PropTypes.array,
- onLoadTokens: PropTypes.func
- };
-
- componentDidMount () {
- this.props.onLoadTokens();
- }
-
- render () {
- return (
-
- );
- }
-}
-
-const mapStateToProps = (state) => {
- const { isLoading, tokens } = state.tokens;
-
- const filteredTokens = tokens
- .filter((token) => token && token.tla)
- .map((token) => ({ tla: token.tla, owner: token.owner }));
-
- return { isLoading, tokens: filteredTokens };
-};
-
-const mapDispatchToProps = (dispatch) => {
- return {
- onLoadTokens: () => {
- dispatch(loadTokens());
- }
- };
-};
-
-export default connect(
- mapStateToProps,
- mapDispatchToProps
-)(TokensContainer);
diff --git a/js/packages/dapp-tokenreg/Tokens/index.js b/js/packages/dapp-tokenreg/Tokens/index.js
deleted file mode 100644
index 0deedaecc..000000000
--- a/js/packages/dapp-tokenreg/Tokens/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './container';
diff --git a/js/packages/dapp-tokenreg/Tokens/reducer.js b/js/packages/dapp-tokenreg/Tokens/reducer.js
deleted file mode 100644
index 55660daf2..000000000
--- a/js/packages/dapp-tokenreg/Tokens/reducer.js
+++ /dev/null
@@ -1,114 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import {
- SET_TOKENS_LOADING,
- SET_TOKEN_COUNT,
- SET_TOKEN_DATA,
- SET_TOKEN_META,
- SET_TOKEN_LOADING,
- SET_TOKEN_META_LOADING,
- SET_TOKEN_PENDING,
- DELETE_TOKEN
-} from './actions';
-
-const initialState = {
- isLoading: true,
- tokens: [],
- tokenCount: 0
-};
-
-export default (state = initialState, action) => {
- switch (action.type) {
- case SET_TOKENS_LOADING:
- return { ...state, isLoading: action.isLoading };
-
- case SET_TOKEN_COUNT:
- return { ...state, tokenCount: action.tokenCount };
-
- case SET_TOKEN_DATA: {
- const index = action.index;
- const tokens = [].concat(state.tokens);
-
- tokens[index] = {
- ...tokens[index],
- ...action.tokenData
- };
-
- return { ...state, tokens: tokens };
- }
-
- case SET_TOKEN_META: {
- const index = action.index;
- const tokens = [].concat(state.tokens);
-
- tokens[index] = {
- ...tokens[index],
- meta: action.meta
- };
-
- return { ...state, tokens: tokens };
- }
-
- case SET_TOKEN_LOADING: {
- const index = action.index;
- const tokens = [].concat(state.tokens);
-
- tokens[index] = {
- ...tokens[index],
- isLoading: action.isLoading
- };
-
- return { ...state, tokens: tokens };
- }
-
- case SET_TOKEN_META_LOADING: {
- const index = action.index;
- const tokens = [].concat(state.tokens);
-
- tokens[index] = {
- ...tokens[index],
- isMetaLoading: action.isMetaLoading
- };
-
- return { ...state, tokens: tokens };
- }
-
- case SET_TOKEN_PENDING: {
- const index = action.index;
- const tokens = [].concat(state.tokens);
-
- tokens[index] = {
- ...tokens[index],
- isPending: action.isPending
- };
-
- return { ...state, tokens: tokens };
- }
-
- case DELETE_TOKEN: {
- const index = action.index;
- const tokens = [].concat(state.tokens);
-
- delete tokens[index];
-
- return { ...state, tokens: tokens };
- }
-
- default:
- return state;
- }
-};
diff --git a/js/packages/dapp-tokenreg/Tokens/tokens.css b/js/packages/dapp-tokenreg/Tokens/tokens.css
deleted file mode 100644
index 86bb348a4..000000000
--- a/js/packages/dapp-tokenreg/Tokens/tokens.css
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.tokens {
- width: 90%;
- padding-top: 2rem;
- display: flex;
- flex-wrap: wrap;
- justify-content: space-around;
-}
diff --git a/js/packages/dapp-tokenreg/Tokens/tokens.js b/js/packages/dapp-tokenreg/Tokens/tokens.js
deleted file mode 100644
index 727b49f50..000000000
--- a/js/packages/dapp-tokenreg/Tokens/tokens.js
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-
-import Token from './Token';
-import Loading from '../Loading';
-
-import styles from './tokens.css';
-
-export default class Tokens extends Component {
- static propTypes = {
- isLoading: PropTypes.bool.isRequired,
- tokens: PropTypes.array
- };
-
- render () {
- const { isLoading, tokens } = this.props;
- const loading = isLoading ? () : null;
-
- return (
-
- { this.renderTokens(tokens) }
- { loading }
-
- );
- }
-
- renderTokens (tokens) {
- return tokens.map((token) => {
- return (
-
- );
- });
- }
-}
diff --git a/js/packages/dapp-tokenreg/constants.js b/js/packages/dapp-tokenreg/constants.js
deleted file mode 100644
index a4d2e3938..000000000
--- a/js/packages/dapp-tokenreg/constants.js
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { URL_TYPE, ADDRESS_TYPE } from './Inputs/validation';
-
-export const metaDataKeys = [
- {
- label: 'Image',
- value: 'IMG',
- validation: URL_TYPE
- },
- {
- label: 'Address',
- value: 'A',
- validation: ADDRESS_TYPE
- }
-];
diff --git a/js/packages/dapp-tokenreg/index.js b/js/packages/dapp-tokenreg/index.js
deleted file mode 100644
index dc07d6eed..000000000
--- a/js/packages/dapp-tokenreg/index.js
+++ /dev/null
@@ -1,54 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import ReactDOM from 'react-dom';
-import React from 'react';
-import { Provider } from 'react-redux';
-import { AppContainer } from 'react-hot-loader';
-
-import injectTapEventPlugin from 'react-tap-event-plugin';
-injectTapEventPlugin();
-
-import store from './store';
-import Container from './Container';
-
-import '@parity/shared/assets/fonts/Roboto/font.css';
-import '@parity/shared/assets/fonts/RobotoMono/font.css';
-import '@parity/dapps/style.css';
-
-ReactDOM.render(
-
-
-
-
- ,
- document.querySelector('#container')
-);
-
-if (module.hot) {
- module.hot.accept('./Container.js', () => {
- require('./Container.js');
-
- ReactDOM.render(
-
-
-
-
- ,
- document.querySelector('#container')
- );
- });
-}
diff --git a/js/packages/dapp-tokenreg/package.json b/js/packages/dapp-tokenreg/package.json
deleted file mode 100644
index 3c1147910..000000000
--- a/js/packages/dapp-tokenreg/package.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "name": "@parity/dapp-tokenreg",
- "description": "Parity Token Registration",
- "version": "1.99.99",
- "main": "index.js",
- "author": "Parity Team ",
- "maintainers": [],
- "contributors": [],
- "license": "GPL-3.0",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/paritytech/dapp-tokenreg.git"
- },
- "keywords": [],
- "scripts": {},
- "devDependencies": {},
- "dependencies": {
- },
- "peerDependencies": {}
-}
diff --git a/js/packages/dapp-tokenreg/parity.js b/js/packages/dapp-tokenreg/parity.js
deleted file mode 100644
index 742386288..000000000
--- a/js/packages/dapp-tokenreg/parity.js
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import Api from '@parity/api';
-
-const ethereumProvider = window.ethereum || window.parent.ethereum;
-
-if (!ethereumProvider) {
- throw new Error('Unable to locate EthereumProvider, object not attached');
-}
-
-const api = new Api(ethereumProvider);
-
-export {
- api
-};
diff --git a/js/packages/dapp-tokenreg/reducers.js b/js/packages/dapp-tokenreg/reducers.js
deleted file mode 100644
index 0f0a27c15..000000000
--- a/js/packages/dapp-tokenreg/reducers.js
+++ /dev/null
@@ -1,28 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { combineReducers } from 'redux';
-
-import status from './Status/reducer';
-import tokens from './Tokens/reducer';
-import actions from './Actions/reducer';
-import accounts from './Accounts/reducer';
-
-const rootReducer = combineReducers({
- status, tokens, actions, accounts
-});
-
-export default rootReducer;
diff --git a/js/packages/dapp-tokenreg/store.js b/js/packages/dapp-tokenreg/store.js
deleted file mode 100644
index ced7a5bae..000000000
--- a/js/packages/dapp-tokenreg/store.js
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { createStore, applyMiddleware } from 'redux';
-import thunk from 'redux-thunk';
-
-import reducer from './reducers';
-
-export default createStore(reducer, applyMiddleware(thunk));
diff --git a/js/packages/dapp-tokenreg/utils.js b/js/packages/dapp-tokenreg/utils.js
deleted file mode 100644
index 315f097f7..000000000
--- a/js/packages/dapp-tokenreg/utils.js
+++ /dev/null
@@ -1,76 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { api } from './parity';
-
-import { eip20 as eip20Abi } from '@parity/shared/contracts/abi';
-
-export const INVALID_URL_HASH = '0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470';
-export const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';
-
-/**
- * Convert the given URL to a content hash,
- * and checks if it is already registered in GHH
- */
-export const urlToHash = (ghhInstance, url) => {
- if (!url || !url.length) {
- return Promise.resolve(null);
- }
-
- return api.parity
- .hashContent(url)
- .catch((error) => {
- const message = error.text || error.message || error.toString();
-
- throw new Error(`${message} (${url})`);
- })
- .then((contentHash) => {
- console.log('lookupHash', url, contentHash);
-
- if (contentHash === INVALID_URL_HASH) {
- throw new Error(`"${url}" is not a valid URL`);
- }
-
- return ghhInstance.entries
- .call({}, [contentHash])
- .then(([accountSlashRepo, commit, contentHashOwner]) => {
- const registered = (contentHashOwner !== ZERO_ADDRESS);
-
- return {
- hash: contentHash,
- registered
- };
- });
- });
-};
-
-export const getTokenTotalSupply = (tokenAddress) => {
- return api
- .eth
- .getCode(tokenAddress)
- .then(code => {
- if (!code || /^(0x)?0?$/.test(code)) {
- return null;
- }
-
- const contract = api.newContract(eip20Abi, tokenAddress);
-
- return contract
- .instance
- .totalSupply
- .call({}, []);
- });
-};
diff --git a/js/packages/dapp-vaults/VaultAccounts/index.js b/js/packages/dapp-vaults/VaultAccounts/index.js
deleted file mode 100644
index 506a569f3..000000000
--- a/js/packages/dapp-vaults/VaultAccounts/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './vaultAccounts';
diff --git a/js/packages/dapp-vaults/VaultAccounts/vaultAccounts.js b/js/packages/dapp-vaults/VaultAccounts/vaultAccounts.js
deleted file mode 100644
index 279749788..000000000
--- a/js/packages/dapp-vaults/VaultAccounts/vaultAccounts.js
+++ /dev/null
@@ -1,187 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { observer } from 'mobx-react';
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-import { connect } from 'react-redux';
-import { bindActionCreators } from 'redux';
-
-import { newError } from '@parity/shared/redux/actions';
-import { personalAccountsInfo } from '@parity/shared/redux/providers/personalActions';
-import { AccountCard, Button, Portal, SelectionList } from '@parity/ui';
-import { CancelIcon, CheckIcon } from '@parity/ui/Icons';
-
-@observer
-class VaultAccounts extends Component {
- static contextTypes = {
- api: PropTypes.object.isRequired
- };
-
- static propTypes = {
- accounts: PropTypes.object.isRequired,
- newError: PropTypes.func.isRequired,
- personalAccountsInfo: PropTypes.func.isRequired,
- vaultStore: PropTypes.object.isRequired
- };
-
- render () {
- const { accounts } = this.props;
- const { isBusyAccounts, isModalAccountsOpen, selectedAccounts } = this.props.vaultStore;
-
- if (!isModalAccountsOpen) {
- return null;
- }
-
- const vaultAccounts = Object
- .keys(accounts)
- .filter((address) => accounts[address].uuid)
- .map((address) => accounts[address]);
-
- return (
- }
- key='cancel'
- label={
-
- }
- onClick={ this.onClose }
- />,
- }
- key='execute'
- label={
-
- }
- onClick={ this.onExecute }
- />
- ] }
- busy={ isBusyAccounts }
- onClose={ this.onClose }
- open
- title={
-
- }
- >
- { this.renderList(vaultAccounts, selectedAccounts) }
-
- );
- }
-
- renderList (vaultAccounts) {
- return (
-
- );
- }
-
- renderAccount = (account) => {
- return (
-
- );
- }
-
- isSelected = (account) => {
- const { vaultName, selectedAccounts } = this.props.vaultStore;
-
- return account.meta.vault === vaultName
- ? !selectedAccounts[account.address]
- : selectedAccounts[account.address];
- }
-
- onSelect = (account) => {
- this.props.vaultStore.toggleSelectedAccount(account.address);
- }
-
- onClose = () => {
- this.props.vaultStore.closeAccountsModal();
- }
-
- onExecute = () => {
- const { api } = this.context;
- const { accounts, personalAccountsInfo, vaultStore } = this.props;
- const { vaultName, selectedAccounts } = this.props.vaultStore;
-
- const vaultAccounts = Object
- .keys(accounts)
- .filter((address) => accounts[address].uuid && selectedAccounts[address])
- .map((address) => accounts[address]);
-
- return vaultStore
- .moveAccounts(
- vaultName,
- vaultAccounts
- .filter((account) => account.meta.vault !== vaultName)
- .map((account) => account.address),
- vaultAccounts
- .filter((account) => account.meta.vault === vaultName)
- .map((account) => account.address)
- )
- .catch(this.props.newError)
- .then(() => {
- // TODO: We manually call parity_allAccountsInfo after all the promises
- // have been resolved. If bulk moves do become available in the future,
- // subscriptions can transparently take care of this instead of calling
- // and manually dispatching an update. (Using subscriptions currently
- // means allAccountsInfo is called after each and every move call)
- return api.parity
- .allAccountsInfo()
- .then(personalAccountsInfo);
- })
- .then(this.onClose);
- }
-}
-
-function mapStateToProps (state) {
- const { accounts } = state.personal;
-
- return {
- accounts
- };
-}
-
-function mapDispatchToProps (dispatch) {
- return bindActionCreators({
- newError,
- personalAccountsInfo
- }, dispatch);
-}
-
-export default connect(
- mapStateToProps,
- mapDispatchToProps
-)(VaultAccounts);
diff --git a/js/packages/dapp-vaults/VaultAccounts/vaultAccounts.spec.js b/js/packages/dapp-vaults/VaultAccounts/vaultAccounts.spec.js
deleted file mode 100644
index 6a0d43b6e..000000000
--- a/js/packages/dapp-vaults/VaultAccounts/vaultAccounts.spec.js
+++ /dev/null
@@ -1,182 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { shallow } from 'enzyme';
-import React from 'react';
-import sinon from 'sinon';
-
-import VaultAccounts from './';
-
-const ACCOUNT_A = '0x1234567890123456789012345678901234567890';
-const ACCOUNT_B = '0x0123456789012345678901234567890123456789';
-const ACCOUNT_C = '0x9012345678901234567890123456789012345678';
-const ACCOUNT_D = '0x8901234567890123456789012345678901234567';
-const VAULTNAME = 'testVault';
-const ACCOUNTS = {
- [ACCOUNT_A]: {
- address: ACCOUNT_A,
- uuid: null
- },
- [ACCOUNT_B]: {
- address: ACCOUNT_B,
- uuid: ACCOUNT_B,
- meta: {
- vault: 'somethingElse'
- }
- },
- [ACCOUNT_C]: {
- address: ACCOUNT_C,
- uuid: ACCOUNT_C,
- meta: {
- vault: VAULTNAME
- }
- },
- [ACCOUNT_D]: {
- address: ACCOUNT_D,
- uuid: ACCOUNT_D,
- meta: {
- vault: VAULTNAME
- }
- }
-};
-
-let api;
-let component;
-let instance;
-let reduxStore;
-let vaultStore;
-
-function createApi () {
- api = {
- parity: {
- allAccountsInfo: sinon.stub().resolves({})
- }
- };
-
- return api;
-}
-
-function createReduxStore () {
- reduxStore = {
- dispatch: sinon.stub(),
- subscribe: sinon.stub(),
- getState: () => {
- return {
- balances: {
- balances: {}
- },
- personal: {
- accounts: ACCOUNTS
- }
- };
- }
- };
-
- return reduxStore;
-}
-
-function createVaultStore () {
- vaultStore = {
- isBusyAccounts: false,
- isModalAccountsOpen: true,
- selectedAccounts: { [ACCOUNT_B]: true, [ACCOUNT_C]: true },
- vaultName: VAULTNAME,
- closeAccountsModal: sinon.stub(),
- moveAccounts: sinon.stub().resolves(true),
- toggleSelectedAccount: sinon.stub()
- };
-
- return vaultStore;
-}
-
-function render () {
- component = shallow(
- ,
- {
- context: {
- store: createReduxStore()
- }
- }
- ).find('VaultAccounts').shallow({
- context: {
- api: createApi()
- }
- });
- instance = component.instance();
-
- return component;
-}
-
-describe('modals/VaultAccounts', () => {
- beforeEach(() => {
- render();
- });
-
- it('renders defaults', () => {
- expect(component).to.be.ok;
- });
-
- describe('components', () => {
- describe('SelectionList', () => {
- let sectionList;
-
- beforeEach(() => {
- sectionList = component.find('SelectionList');
- });
-
- it('has the filtered accounts', () => {
- expect(sectionList.props().items).to.deep.equal([
- ACCOUNTS[ACCOUNT_B], ACCOUNTS[ACCOUNT_C], ACCOUNTS[ACCOUNT_D]
- ]);
- });
-
- it('renders via renderAccount', () => {
- expect(sectionList.props().renderItem).to.equal(instance.renderAccount);
- });
- });
- });
-
- describe('event handlers', () => {
- describe('onClose', () => {
- beforeEach(() => {
- instance.onClose();
- });
-
- it('calls into closeAccountsModal', () => {
- expect(vaultStore.closeAccountsModal).to.have.been.called;
- });
- });
-
- describe('onExecute', () => {
- beforeEach(() => {
- sinon.spy(instance, 'onClose');
- return instance.onExecute();
- });
-
- afterEach(() => {
- instance.onClose.restore();
- });
-
- it('calls into moveAccounts', () => {
- expect(vaultStore.moveAccounts).to.have.been.calledWith(VAULTNAME, [ACCOUNT_B], [ACCOUNT_C]);
- });
-
- it('closes modal', () => {
- expect(instance.onClose).to.have.been.called;
- });
- });
- });
-});
diff --git a/js/packages/dapp-vaults/VaultCreate/index.js b/js/packages/dapp-vaults/VaultCreate/index.js
deleted file mode 100644
index 24bf5bf06..000000000
--- a/js/packages/dapp-vaults/VaultCreate/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './vaultCreate';
diff --git a/js/packages/dapp-vaults/VaultCreate/vaultCreate.css b/js/packages/dapp-vaults/VaultCreate/vaultCreate.css
deleted file mode 100644
index 125d26217..000000000
--- a/js/packages/dapp-vaults/VaultCreate/vaultCreate.css
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-/* TODO: These styles are shared with CreateAccount - DRY up */
-.passwords {
- display: flex;
- flex-wrap: wrap;
-
- .password {
- box-sizing: border-box;
- flex: 0 1 50%;
- width: 50%;
-
- &:nth-child(odd) {
- padding-right: 0.25rem;
- }
-
- &:nth-child(even) {
- padding-left: 0.25rem;
- }
- }
-}
-
-.disabled {
- opacity: 0.25;
-}
-
-.group+.group {
- margin-top: 1em;
-}
diff --git a/js/packages/dapp-vaults/VaultCreate/vaultCreate.js b/js/packages/dapp-vaults/VaultCreate/vaultCreate.js
deleted file mode 100644
index e93342189..000000000
--- a/js/packages/dapp-vaults/VaultCreate/vaultCreate.js
+++ /dev/null
@@ -1,228 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { observer } from 'mobx-react';
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-import { connect } from 'react-redux';
-import { bindActionCreators } from 'redux';
-
-import { newError } from '@parity/shared/redux/actions';
-import { Button, Input, Portal } from '@parity/ui';
-import PasswordStrength from '@parity/ui/Form/PasswordStrength';
-import { CheckIcon, CloseIcon } from '@parity/ui/Icons';
-
-import styles from './vaultCreate.css';
-
-@observer
-class VaultCreate extends Component {
- static propTypes = {
- newError: PropTypes.func.isRequired,
- vaultStore: PropTypes.object.isRequired
- }
-
- render () {
- const { isBusyCreate, isModalCreateOpen, vaultDescription, vaultName, vaultNameError, vaultPassword, vaultPasswordHint, vaultPasswordRepeat, vaultPasswordRepeatError } = this.props.vaultStore;
- const hasError = !!vaultNameError || !!vaultPasswordRepeatError;
-
- if (!isModalCreateOpen) {
- return null;
- }
-
- return (
- }
- key='close'
- label={
-
- }
- onClick={ this.onClose }
- />,
- }
- key='vault'
- label={
-
- }
- onClick={ this.onCreate }
- />
- ] }
- onClose={ this.onClose }
- open
- title={
-
- }
- >
-
-
- );
- }
-
- onEditDescription = (event, description) => {
- this.props.vaultStore.setVaultDescription(description);
- }
-
- onEditName = (event, name) => {
- this.props.vaultStore.setVaultName(name);
- }
-
- onEditPassword = (event, password) => {
- this.props.vaultStore.setVaultPassword(password);
- }
-
- onEditPasswordHint = (event, hint) => {
- this.props.vaultStore.setVaultPasswordHint(hint);
- }
-
- onEditPasswordRepeat = (event, password) => {
- this.props.vaultStore.setVaultPasswordRepeat(password);
- }
-
- onCreate = () => {
- const { vaultNameError, vaultPasswordRepeatError } = this.props.vaultStore;
-
- if (vaultNameError || vaultPasswordRepeatError) {
- return;
- }
-
- return this.props.vaultStore
- .createVault()
- .catch(this.props.newError)
- .then(this.onClose);
- }
-
- onClose = () => {
- this.props.vaultStore.closeCreateModal();
- }
-}
-
-function mapDispatchToProps (dispatch) {
- return bindActionCreators({
- newError
- }, dispatch);
-}
-
-export default connect(
- null,
- mapDispatchToProps
-)(VaultCreate);
diff --git a/js/packages/dapp-vaults/VaultCreate/vaultCreate.spec.js b/js/packages/dapp-vaults/VaultCreate/vaultCreate.spec.js
deleted file mode 100644
index f807ac0b4..000000000
--- a/js/packages/dapp-vaults/VaultCreate/vaultCreate.spec.js
+++ /dev/null
@@ -1,162 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { shallow } from 'enzyme';
-import React from 'react';
-import sinon from 'sinon';
-
-import VaultCreate from './';
-
-let component;
-let instance;
-let reduxStore;
-let vaultStore;
-
-function vaultReduxStore () {
- reduxStore = {
- dispatch: sinon.stub(),
- subscribe: sinon.stub(),
- getState: sinon.stub()
- };
-
- return reduxStore;
-}
-
-function vaultVaultStore () {
- vaultStore = {
- isBusyCreate: false,
- isModalCreateOpen: true,
- vaultDescription: 'initialDesc',
- vaultName: 'initialName',
- vaultPassword: 'initialPassword',
- vaultPasswordRepeat: 'initialPassword',
- vaultPasswordHint: 'initialHint',
- closeCreateModal: sinon.stub(),
- createVault: sinon.stub().resolves(true),
- setVaultDescription: sinon.stub(),
- setVaultName: sinon.stub(),
- setVaultPassword: sinon.stub(),
- setVaultPasswordHint: sinon.stub(),
- setVaultPasswordRepeat: sinon.stub()
- };
-
- return vaultStore;
-}
-
-function render () {
- component = shallow(
- ,
- {
- context: {
- store: vaultReduxStore()
- }
- }
- ).find('VaultCreate').shallow();
- instance = component.instance();
-
- return component;
-}
-
-describe('modals/VaultCreate', () => {
- beforeEach(() => {
- render();
- });
-
- it('renders defaults', () => {
- expect(component).to.be.ok;
- });
-
- describe('event handlers', () => {
- describe('onClose', () => {
- beforeEach(() => {
- instance.onClose();
- });
-
- it('calls into closeCreateModal', () => {
- expect(vaultStore.closeCreateModal).to.have.been.called;
- });
- });
-
- describe('onCreate', () => {
- beforeEach(() => {
- sinon.spy(instance, 'onClose');
- return instance.onCreate();
- });
-
- afterEach(() => {
- instance.onClose.restore();
- });
-
- it('calls into createVault', () => {
- expect(vaultStore.createVault).to.have.been.called;
- });
-
- it('closes modal', () => {
- expect(instance.onClose).to.have.been.called;
- });
- });
-
- describe('onEditDescription', () => {
- beforeEach(() => {
- instance.onEditDescription(null, 'testDescription');
- });
-
- it('calls setVaultDescription', () => {
- expect(vaultStore.setVaultDescription).to.have.been.calledWith('testDescription');
- });
- });
-
- describe('onEditName', () => {
- beforeEach(() => {
- instance.onEditName(null, 'testName');
- });
-
- it('calls setVaultName', () => {
- expect(vaultStore.setVaultName).to.have.been.calledWith('testName');
- });
- });
-
- describe('onEditPassword', () => {
- beforeEach(() => {
- instance.onEditPassword(null, 'testPassword');
- });
-
- it('calls setVaultPassword', () => {
- expect(vaultStore.setVaultPassword).to.have.been.calledWith('testPassword');
- });
- });
-
- describe('onEditPasswordHint', () => {
- beforeEach(() => {
- instance.onEditPasswordHint(null, 'testPasswordHint');
- });
-
- it('calls setVaultPasswordHint', () => {
- expect(vaultStore.setVaultPasswordHint).to.have.been.calledWith('testPasswordHint');
- });
- });
-
- describe('onEditPasswordRepeat', () => {
- beforeEach(() => {
- instance.onEditPasswordRepeat(null, 'testPassword');
- });
-
- it('calls setVaultPasswordRepeat', () => {
- expect(vaultStore.setVaultPasswordRepeat).to.have.been.calledWith('testPassword');
- });
- });
- });
-});
diff --git a/js/packages/dapp-vaults/VaultLock/index.js b/js/packages/dapp-vaults/VaultLock/index.js
deleted file mode 100644
index ffdab6191..000000000
--- a/js/packages/dapp-vaults/VaultLock/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './vaultLock';
diff --git a/js/packages/dapp-vaults/VaultLock/vaultLock.js b/js/packages/dapp-vaults/VaultLock/vaultLock.js
deleted file mode 100644
index cdc1c21a4..000000000
--- a/js/packages/dapp-vaults/VaultLock/vaultLock.js
+++ /dev/null
@@ -1,93 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { observer } from 'mobx-react';
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-import { connect } from 'react-redux';
-import { bindActionCreators } from 'redux';
-
-import { newError } from '@parity/shared/redux/actions';
-import { ConfirmDialog, VaultCard } from '@parity/ui';
-
-import styles from '../VaultUnlock/vaultUnlock.css';
-
-@observer
-class VaultLock extends Component {
- static propTypes = {
- newError: PropTypes.func.isRequired,
- vaultStore: PropTypes.object.isRequired
- }
-
- render () {
- const { isBusyLock, isModalLockOpen, vault } = this.props.vaultStore;
-
- if (!isModalLockOpen) {
- return null;
- }
-
- return (
-
- }
- >
-
-
-
-
-
- );
- }
-
- onExecute = () => {
- return this.props.vaultStore
- .closeVault()
- .catch(this.props.newError)
- .then(this.onClose);
- }
-
- onClose = () => {
- this.props.vaultStore.closeLockModal();
- }
-}
-
-function mapDispatchToProps (dispatch) {
- return bindActionCreators({
- newError
- }, dispatch);
-}
-
-export default connect(
- null,
- mapDispatchToProps
-)(VaultLock);
diff --git a/js/packages/dapp-vaults/VaultLock/vaultLock.spec.js b/js/packages/dapp-vaults/VaultLock/vaultLock.spec.js
deleted file mode 100644
index 53f19241d..000000000
--- a/js/packages/dapp-vaults/VaultLock/vaultLock.spec.js
+++ /dev/null
@@ -1,131 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { shallow } from 'enzyme';
-import React from 'react';
-import sinon from 'sinon';
-
-import VaultLock from './';
-
-const VAULT = {
- name: 'testVault'
-};
-
-let component;
-let instance;
-let reduxStore;
-let vaultStore;
-
-function createReduxStore () {
- reduxStore = {
- dispatch: sinon.stub(),
- subscribe: sinon.stub(),
- getState: () => {
- return {};
- }
- };
-
- return reduxStore;
-}
-
-function createVaultStore () {
- vaultStore = {
- isBusyLock: false,
- isModalLockOpen: true,
- vault: VAULT,
- vaultName: VAULT.name,
- vaults: [VAULT],
- closeLockModal: sinon.stub(),
- closeVault: sinon.stub().resolves(true)
- };
-
- return vaultStore;
-}
-
-function render () {
- component = shallow(
- ,
- {
- context: {
- store: createReduxStore()
- }
- }
- ).find('VaultLock').shallow();
- instance = component.instance();
-
- return component;
-}
-
-describe('modals/VaultLock', () => {
- beforeEach(() => {
- render();
- });
-
- it('renders defaults', () => {
- expect(component).to.be.ok;
- });
-
- describe('ConfirmDialog', () => {
- let dialog;
-
- beforeEach(() => {
- dialog = component.find('ConfirmDialog');
- });
-
- it('renders the dialog', () => {
- expect(dialog.get(0)).to.be.ok;
- });
-
- it('passes onConfirm as onExecute', () => {
- expect(dialog.props().onConfirm).to.equal(instance.onExecute);
- });
-
- it('passes onDeny as onClose', () => {
- expect(dialog.props().onDeny).to.equal(instance.onClose);
- });
- });
-
- describe('event methods', () => {
- describe('onExecute', () => {
- beforeEach(() => {
- sinon.stub(instance, 'onClose');
- return instance.onExecute();
- });
-
- afterEach(() => {
- instance.onClose.restore();
- });
-
- it('closes the modal', () => {
- expect(instance.onClose).to.have.been.called;
- });
-
- it('calls into vaultStore.closeVault', () => {
- expect(vaultStore.closeVault).to.have.been.called;
- });
- });
-
- describe('onClose', () => {
- beforeEach(() => {
- instance.onClose();
- });
-
- it('calls into closeLockModal', () => {
- expect(vaultStore.closeLockModal).to.have.been.called;
- });
- });
- });
-});
diff --git a/js/packages/dapp-vaults/VaultMeta/index.js b/js/packages/dapp-vaults/VaultMeta/index.js
deleted file mode 100644
index 685c54ef3..000000000
--- a/js/packages/dapp-vaults/VaultMeta/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './vaultMeta';
diff --git a/js/packages/dapp-vaults/VaultMeta/vaultMeta.js b/js/packages/dapp-vaults/VaultMeta/vaultMeta.js
deleted file mode 100644
index 0af817dbd..000000000
--- a/js/packages/dapp-vaults/VaultMeta/vaultMeta.js
+++ /dev/null
@@ -1,299 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { observer } from 'mobx-react';
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-import { connect } from 'react-redux';
-import { bindActionCreators } from 'redux';
-
-import { newError } from '@parity/shared/redux/actions';
-import { Button, Checkbox, Form, Input, Portal, VaultCard } from '@parity/ui';
-import PasswordStrength from '@parity/ui/Form/PasswordStrength';
-import { CheckIcon, CloseIcon } from '@parity/ui/Icons';
-
-import styles from '../VaultCreate/vaultCreate.css';
-
-@observer
-class VaultMeta extends Component {
- static propTypes = {
- newError: PropTypes.func.isRequired,
- vaultStore: PropTypes.object.isRequired
- };
-
- state = {
- passwordEdit: false
- };
-
- render () {
- const { isBusyMeta, isModalMetaOpen, vault, vaultDescription, vaultPassword, vaultPasswordRepeat, vaultPasswordRepeatError, vaultPasswordOld, vaultPasswordHint } = this.props.vaultStore;
- const { passwordEdit } = this.state;
-
- if (!isModalMetaOpen) {
- return null;
- }
-
- return (
- }
- key='close'
- label={
-
- }
- onClick={ this.onClose }
- />,
- }
- key='vault'
- label={
-
- }
- onClick={ this.onExecute }
- />
- ] }
- onClose={ this.onClose }
- open
- title={
-
- }
- >
-
-
-
-
- );
-
- //
- // }
- // label={
- //
- // }
- // onTokensChange={ this.onEditTags }
- // tokens={ vaultTags.slice() }
- // />
- }
-
- onEditDescription = (event, description) => {
- this.props.vaultStore.setVaultDescription(description);
- }
-
- onEditPasswordCurrent = (event, password) => {
- this.props.vaultStore.setVaultPasswordOld(password);
- }
-
- onEditPassword = (event, password) => {
- this.props.vaultStore.setVaultPassword(password);
- }
-
- onEditPasswordHint = (event, hint) => {
- this.props.vaultStore.setVaultPasswordHint(hint);
- }
-
- onEditPasswordRepeat = (event, password) => {
- this.props.vaultStore.setVaultPasswordRepeat(password);
- }
-
- onEditTags = (tags) => {
- this.props.vaultStore.setVaultTags(tags);
- }
-
- onTogglePassword = () => {
- this.setState({
- passwordEdit: !this.state.passwordEdit
- });
- }
-
- onExecute = () => {
- const { vaultPasswordRepeatError } = this.props.vaultStore;
- const { passwordEdit } = this.state;
-
- if (vaultPasswordRepeatError) {
- return;
- }
-
- return Promise
- .all([
- passwordEdit
- ? this.props.vaultStore.editVaultPassword()
- : true
- ])
- .then(() => {
- return this.props.vaultStore.editVaultMeta();
- })
- .catch(this.props.newError)
- .then(this.onClose);
- }
-
- onClose = () => {
- this.setState({
- passwordEdit: false
- });
-
- this.props.vaultStore.closeMetaModal();
- }
-}
-
-function mapDispatchToProps (dispatch) {
- return bindActionCreators({
- newError
- }, dispatch);
-}
-
-export default connect(
- null,
- mapDispatchToProps
-)(VaultMeta);
diff --git a/js/packages/dapp-vaults/VaultMeta/vaultMeta.spec.js b/js/packages/dapp-vaults/VaultMeta/vaultMeta.spec.js
deleted file mode 100644
index c616c8e6a..000000000
--- a/js/packages/dapp-vaults/VaultMeta/vaultMeta.spec.js
+++ /dev/null
@@ -1,171 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { shallow } from 'enzyme';
-import React from 'react';
-import sinon from 'sinon';
-
-import VaultMeta from './';
-
-const VAULT = {
- name: 'testVault'
-};
-
-let component;
-let instance;
-let reduxStore;
-let vaultStore;
-
-function createReduxStore () {
- reduxStore = {
- dispatch: sinon.stub(),
- subscribe: sinon.stub(),
- getState: () => {
- return {};
- }
- };
-
- return reduxStore;
-}
-
-function createVaultStore () {
- vaultStore = {
- isBusyMeta: false,
- isModalMetaOpen: true,
- vault: VAULT,
- vaultDescription: '',
- vaultTags: [],
- vaultName: VAULT.name,
- vaults: [VAULT],
- closeMetaModal: sinon.stub(),
- editVaultMeta: sinon.stub().resolves(true),
- editVaultPassword: sinon.stub().resolves(true),
- setVaultDescription: sinon.stub(),
- setVaultPassword: sinon.stub(),
- setVaultPasswordRepeat: sinon.stub(),
- setVaultPasswordHint: sinon.stub(),
- setVaultPasswordOld: sinon.stub(),
- setVaultTags: sinon.stub()
- };
-
- return vaultStore;
-}
-
-function render (props = {}) {
- component = shallow(
- ,
- {
- context: {
- store: createReduxStore()
- }
- }
- ).find('VaultMeta').shallow();
- instance = component.instance();
-
- return component;
-}
-
-describe('modals/VaultMeta', () => {
- beforeEach(() => {
- render();
- });
-
- it('renders defaults', () => {
- expect(component).to.be.ok;
- });
-
- describe('event methods', () => {
- describe('onEditDescription', () => {
- beforeEach(() => {
- instance.onEditDescription(null, 'testing');
- });
-
- it('calls into setVaultDescription', () => {
- expect(vaultStore.setVaultDescription).to.have.been.calledWith('testing');
- });
- });
-
- describe('onEditPassword', () => {
- beforeEach(() => {
- instance.onEditPassword(null, 'testPassword');
- });
-
- it('calls setVaultPassword', () => {
- expect(vaultStore.setVaultPassword).to.have.been.calledWith('testPassword');
- });
- });
-
- describe('onEditPasswordHint', () => {
- beforeEach(() => {
- instance.onEditPasswordHint(null, 'testPasswordHint');
- });
-
- it('calls setVaultPasswordHint', () => {
- expect(vaultStore.setVaultPasswordHint).to.have.been.calledWith('testPasswordHint');
- });
- });
-
- describe('onEditPasswordCurrent', () => {
- beforeEach(() => {
- instance.onEditPasswordCurrent(null, 'testPasswordOld');
- });
-
- it('calls setVaultPasswordHint', () => {
- expect(vaultStore.setVaultPasswordOld).to.have.been.calledWith('testPasswordOld');
- });
- });
-
- describe('onEditPasswordRepeat', () => {
- beforeEach(() => {
- instance.onEditPasswordRepeat(null, 'testPassword');
- });
-
- it('calls setVaultPasswordRepeat', () => {
- expect(vaultStore.setVaultPasswordRepeat).to.have.been.calledWith('testPassword');
- });
- });
-
- describe('onEditTags', () => {
- beforeEach(() => {
- instance.onEditTags('testing');
- });
-
- it('calls into setVaultTags', () => {
- expect(vaultStore.setVaultTags).to.have.been.calledWith('testing');
- });
- });
-
- describe('onClose', () => {
- beforeEach(() => {
- instance.onClose();
- });
-
- it('calls into closeMetaModal', () => {
- expect(vaultStore.closeMetaModal).to.have.been.called;
- });
- });
-
- describe('onExecute', () => {
- beforeEach(() => {
- return instance.onExecute();
- });
-
- it('calls into editVaultMeta', () => {
- expect(vaultStore.editVaultMeta).to.have.been.called;
- });
- });
- });
-});
diff --git a/js/packages/dapp-vaults/VaultUnlock/index.js b/js/packages/dapp-vaults/VaultUnlock/index.js
deleted file mode 100644
index 71ef6c7e8..000000000
--- a/js/packages/dapp-vaults/VaultUnlock/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './vaultUnlock';
diff --git a/js/packages/dapp-vaults/VaultUnlock/vaultUnlock.css b/js/packages/dapp-vaults/VaultUnlock/vaultUnlock.css
deleted file mode 100644
index 6c1613312..000000000
--- a/js/packages/dapp-vaults/VaultUnlock/vaultUnlock.css
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.form {
- margin-top: 0;
-}
-
-.passwordHint {
- color: rgba(255, 255, 255, 0.5);
- font-size: 0.75em;
- text-align: left;
-}
-
-.textbox {
- line-height: 1.5em;
- margin-bottom: 1.5em;
-}
diff --git a/js/packages/dapp-vaults/VaultUnlock/vaultUnlock.js b/js/packages/dapp-vaults/VaultUnlock/vaultUnlock.js
deleted file mode 100644
index b2d140038..000000000
--- a/js/packages/dapp-vaults/VaultUnlock/vaultUnlock.js
+++ /dev/null
@@ -1,122 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { observer } from 'mobx-react';
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-import { connect } from 'react-redux';
-import { bindActionCreators } from 'redux';
-
-import { newError } from '@parity/shared/redux/actions';
-import { ConfirmDialog, Form, Input, VaultCard } from '@parity/ui';
-
-import styles from './vaultUnlock.css';
-
-@observer
-class VaultUnlock extends Component {
- static propTypes = {
- newError: PropTypes.func.isRequired,
- vaultStore: PropTypes.object.isRequired
- }
-
- render () {
- const { isBusyUnlock, isModalUnlockOpen, vault, vaultPassword } = this.props.vaultStore;
-
- if (!isModalUnlockOpen) {
- return null;
- }
-
- return (
-
- }
- >
-
-
-
-
-
-
- );
- }
-
- onEditPassword = (event, password) => {
- this.props.vaultStore.setVaultPassword(password);
- }
-
- onClose = () => {
- this.props.vaultStore.closeUnlockModal();
- }
-
- onExecute = () => {
- return this.props.vaultStore
- .openVault()
- .catch(this.props.newError)
- .then(this.onClose);
- }
-}
-
-function mapDispatchToProps (dispatch) {
- return bindActionCreators({
- newError
- }, dispatch);
-}
-
-export default connect(
- null,
- mapDispatchToProps
-)(VaultUnlock);
diff --git a/js/packages/dapp-vaults/VaultUnlock/vaultUnlock.spec.js b/js/packages/dapp-vaults/VaultUnlock/vaultUnlock.spec.js
deleted file mode 100644
index b1696833d..000000000
--- a/js/packages/dapp-vaults/VaultUnlock/vaultUnlock.spec.js
+++ /dev/null
@@ -1,146 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { shallow } from 'enzyme';
-import React from 'react';
-import sinon from 'sinon';
-
-import VaultUnlock from './';
-
-const VAULT = {
- name: 'testVault',
- meta: {
- passwordHint: 'some hint'
- }
-};
-
-let component;
-let instance;
-let reduxStore;
-let vaultStore;
-
-function createReduxStore () {
- reduxStore = {
- dispatch: sinon.stub(),
- subscribe: sinon.stub(),
- getState: () => {
- return {};
- }
- };
-
- return reduxStore;
-}
-
-function createVaultStore () {
- vaultStore = {
- isBusyUnlock: false,
- isModalUnlockOpen: true,
- vault: VAULT,
- vaultName: VAULT.name,
- vaultPassword: 'testPassword',
- vaults: [VAULT],
- closeUnlockModal: sinon.stub(),
- openVault: sinon.stub().resolves(true),
- setVaultPassword: sinon.stub()
- };
-
- return vaultStore;
-}
-
-function render () {
- component = shallow(
- ,
- {
- context: {
- store: createReduxStore()
- }
- }
- ).find('VaultUnlock').shallow();
- instance = component.instance();
-
- return component;
-}
-
-describe('modals/VaultUnlock', () => {
- beforeEach(() => {
- render();
- });
-
- it('renders defaults', () => {
- expect(component).to.be.ok;
- });
-
- describe('ConfirmDialog', () => {
- let dialog;
-
- beforeEach(() => {
- dialog = component.find('ConfirmDialog');
- });
-
- it('renders the dialog', () => {
- expect(dialog.get(0)).to.be.ok;
- });
-
- it('passes onConfirm as onExecute', () => {
- expect(dialog.props().onConfirm).to.equal(instance.onExecute);
- });
-
- it('passes onDeny as onClose', () => {
- expect(dialog.props().onDeny).to.equal(instance.onClose);
- });
- });
-
- describe('event methods', () => {
- describe('onExecute', () => {
- beforeEach(() => {
- sinon.stub(instance, 'onClose');
- return instance.onExecute();
- });
-
- afterEach(() => {
- instance.onClose.restore();
- });
-
- it('closes the modal', () => {
- expect(instance.onClose).to.have.been.called;
- });
-
- it('calls into vaultStore.openVault', () => {
- expect(vaultStore.openVault).to.have.been.called;
- });
- });
-
- describe('onClose', () => {
- beforeEach(() => {
- instance.onClose();
- });
-
- it('calls into closeUnlockModal', () => {
- expect(vaultStore.closeUnlockModal).to.have.been.called;
- });
- });
-
- describe('onEditPassword', () => {
- beforeEach(() => {
- instance.onEditPassword(null, 'someVaultPassword');
- });
-
- it('calls into vaultStore.setVaultPassword', () => {
- expect(vaultStore.setVaultPassword).to.have.been.calledWith('someVaultPassword');
- });
- });
- });
-});
diff --git a/js/packages/dapp-vaults/api.js b/js/packages/dapp-vaults/api.js
deleted file mode 100644
index b2e52cca0..000000000
--- a/js/packages/dapp-vaults/api.js
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import Api from '@parity/api';
-
-const ethereumProvider = window.ethereum || window.parent.ethereum;
-
-if (!ethereumProvider) {
- throw new Error('Unable to locate EthereumProvider, object not attached');
-}
-
-export default new Api(ethereumProvider);
diff --git a/js/packages/dapp-vaults/index.js b/js/packages/dapp-vaults/index.js
deleted file mode 100644
index 1c0d67b90..000000000
--- a/js/packages/dapp-vaults/index.js
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import ReactDOM from 'react-dom';
-import React from 'react';
-import { Route, Router, hashHistory } from 'react-router';
-
-import injectTapEventPlugin from 'react-tap-event-plugin';
-injectTapEventPlugin();
-
-import ContractInstances from '@parity/shared/contracts';
-import { initStore } from '@parity/shared/redux';
-import ContextProvider from '@parity/ui/ContextProvider';
-
-import api from './api';
-
-import Vaults from './vaults';
-
-ContractInstances.get(api);
-
-const store = initStore(api, hashHistory);
-
-ReactDOM.render(
-
-
-
-
- ,
- document.querySelector('#container')
-);
diff --git a/js/packages/dapp-vaults/package.json b/js/packages/dapp-vaults/package.json
deleted file mode 100644
index a81b7428a..000000000
--- a/js/packages/dapp-vaults/package.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "name": "@parity/dapp-vaults",
- "description": "Parity default Vaults view",
- "version": "1.99.99",
- "main": "index.js",
- "author": "Parity Team ",
- "maintainers": [],
- "contributors": [],
- "license": "GPL-3.0",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/paritytech/dapp-vaults.git"
- },
- "keywords": [],
- "scripts": {},
- "devDependencies": {},
- "dependencies": {},
- "peerDependencies": {}
-}
diff --git a/js/packages/dapp-vaults/store.js b/js/packages/dapp-vaults/store.js
deleted file mode 100644
index 7ed6c6422..000000000
--- a/js/packages/dapp-vaults/store.js
+++ /dev/null
@@ -1,431 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { action, computed, observable, transaction } from 'mobx';
-
-// TODO: We need to move this to a generic location, it should most probably be
-// merged with the other valitation errors. Import here better than duplication.
-import ERRORS from '@parity/dapp-accounts/CreateAccount/errors';
-
-let instance;
-
-export default class Store {
- @observable isBusyAccounts = false;
- @observable isBusyCreate = false;
- @observable isBusyLoad = false;
- @observable isBusyLock = false;
- @observable isBusyMeta = false;
- @observable isBusyUnlock = false;
- @observable isModalAccountsOpen = false;
- @observable isModalCreateOpen = false;
- @observable isModalLockOpen = false;
- @observable isModalMetaOpen = false;
- @observable isModalUnlockOpen = false;
- @observable selectedAccounts = {};
- @observable vault = null;
- @observable vaults = [];
- @observable vaultsOpened = [];
- @observable vaultNames = [];
- @observable vaultName = '';
- @observable vaultNameError = ERRORS.noName;
- @observable vaultDescription = '';
- @observable vaultPassword = '';
- @observable vaultPasswordHint = '';
- @observable vaultPasswordOld = '';
- @observable vaultPasswordRepeat = '';
- @observable vaultTags = [];
-
- constructor (api) {
- this._api = api;
- }
-
- @computed get vaultPasswordRepeatError () {
- return this.vaultPassword === this.vaultPasswordRepeat
- ? null
- : ERRORS.noMatchPassword;
- }
-
- @action clearVaultFields = () => {
- transaction(() => {
- this.setVaultName('');
- this.setVaultDescription('');
- this.setVaultPassword('');
- this.setVaultPasswordHint('');
- this.setVaultPasswordOld('');
- this.setVaultPasswordRepeat('');
- this.setVaultTags([]);
- });
- }
-
- @action setBusyAccounts = (isBusy) => {
- this.isBusyAccounts = isBusy;
- }
-
- @action setBusyCreate = (isBusy) => {
- this.isBusyCreate = isBusy;
- }
-
- @action setBusyLoad = (isBusy) => {
- this.isBusyLoad = isBusy;
- }
-
- @action setBusyLock = (isBusy) => {
- this.isBusyLock = isBusy;
- }
-
- @action setBusyMeta = (isBusy) => {
- this.isBusyMeta = isBusy;
- }
-
- @action setBusyUnlock = (isBusy) => {
- this.isBusyUnlock = isBusy;
- }
-
- @action setModalAccountsOpen = (isOpen) => {
- transaction(() => {
- this.setBusyAccounts(false);
- this.isModalAccountsOpen = isOpen;
- });
- }
-
- @action setModalCreateOpen = (isOpen) => {
- transaction(() => {
- this.setBusyCreate(false);
- this.isModalCreateOpen = isOpen;
- });
- }
-
- @action setModalLockOpen = (isOpen) => {
- transaction(() => {
- this.setBusyLock(false);
- this.isModalLockOpen = isOpen;
- });
- }
-
- @action setModalMetaOpen = (isOpen) => {
- transaction(() => {
- this.setBusyMeta(false);
- this.isModalMetaOpen = isOpen;
- });
- }
-
- @action setModalUnlockOpen = (isOpen) => {
- transaction(() => {
- this.setBusyUnlock(false);
- this.setVaultPassword('');
- this.isModalUnlockOpen = isOpen;
- });
- }
-
- @action setSelectedAccounts = (selectedAccounts) => {
- this.selectedAccounts = selectedAccounts;
- }
-
- @action setVaults = (allVaults, openedVaults, metaData) => {
- transaction(() => {
- this.vaultNames = allVaults.map((name) => name.toLowerCase());
- this.vaults = allVaults.map((name, index) => {
- return {
- meta: metaData[index] || {},
- name,
- isOpen: openedVaults.includes(name)
- };
- });
- this.vaultsOpened = this.vaults.filter((vault) => vault.isOpen);
- });
- }
-
- @action setVaultDescription = (description) => {
- this.vaultDescription = description;
- }
-
- @action setVaultName = (name) => {
- let nameError = null;
-
- if (!name || !name.trim().length) {
- nameError = ERRORS.noName;
- } else {
- const lowerName = name.toLowerCase();
-
- if (this.vaultNames.includes(lowerName)) {
- nameError = ERRORS.duplicateName;
- }
- }
-
- transaction(() => {
- this.vault = this.vaults.find((vault) => vault.name === name);
- this.vaultName = name;
- this.vaultNameError = nameError;
- });
- }
-
- @action setVaultPassword = (password) => {
- this.vaultPassword = password;
- }
-
- @action setVaultPasswordHint = (hint) => {
- this.vaultPasswordHint = hint;
- }
-
- @action setVaultPasswordOld = (password) => {
- this.vaultPasswordOld = password;
- }
-
- @action setVaultPasswordRepeat = (password) => {
- this.vaultPasswordRepeat = password;
- }
-
- @action setVaultTags = (tags) => {
- this.vaultTags = tags;
- }
-
- @action toggleSelectedAccount = (address) => {
- this.setSelectedAccounts(Object.assign({}, this.selectedAccounts, {
- [address]: !this.selectedAccounts[address] })
- );
- }
-
- closeAccountsModal () {
- this.setModalAccountsOpen(false);
- }
-
- closeCreateModal () {
- this.setModalCreateOpen(false);
- }
-
- closeLockModal () {
- this.setModalLockOpen(false);
- }
-
- closeMetaModal () {
- this.setModalMetaOpen(false);
- }
-
- closeUnlockModal () {
- this.setModalUnlockOpen(false);
- }
-
- openAccountsModal (name) {
- transaction(() => {
- this.setVaultName(name);
- this.setSelectedAccounts({});
- this.setModalAccountsOpen(true);
- });
- }
-
- openCreateModal () {
- transaction(() => {
- this.clearVaultFields();
- this.setModalCreateOpen(true);
- });
- }
-
- openLockModal (name) {
- transaction(() => {
- this.setVaultName(name);
- this.setModalLockOpen(true);
- });
- }
-
- openMetaModal (name) {
- transaction(() => {
- this.clearVaultFields();
- this.setVaultName(name);
-
- if (this.vault && this.vault.meta) {
- this.setVaultDescription(this.vault.meta.description);
- this.setVaultPasswordHint(this.vault.meta.passwordHint);
- }
-
- this.setModalMetaOpen(true);
- });
- }
-
- openUnlockModal (name) {
- transaction(() => {
- this.setVaultName(name);
- this.setModalUnlockOpen(true);
- });
- }
-
- loadVaults = () => {
- this.setBusyLoad(true);
-
- return Promise
- .all([
- this._api.parity.listVaults(),
- this._api.parity.listOpenedVaults()
- ])
- .then(([allVaults, openedVaults]) => {
- return Promise
- .all(allVaults.map((name) => this._api.parity.getVaultMeta(name)))
- .then((metaData) => {
- transaction(() => {
- this.setBusyLoad(false);
- this.setVaults(allVaults, openedVaults, metaData);
- });
- });
- })
- .catch((error) => {
- console.warn('loadVaults', error);
- this.setBusyLoad(false);
- });
- }
-
- closeVault () {
- this.setBusyLock(true);
-
- return this._api.parity
- .closeVault(this.vaultName)
- .then(this.loadVaults)
- .then(() => {
- this.setBusyLock(false);
- })
- .catch((error) => {
- console.error('closeVault', error);
- this.setBusyLock(false);
- throw error;
- });
- }
-
- createVault () {
- if (this.vaultNameError || this.vaultPasswordRepeatError) {
- return Promise.reject();
- }
-
- this.setBusyCreate(true);
-
- return this._api.parity
- .newVault(this.vaultName, this.vaultPassword)
- .then(() => {
- return this._api.parity.setVaultMeta(this.vaultName, {
- description: this.vaultDescription,
- passwordHint: this.vaultPasswordHint,
- tags: this.vaultTags
- });
- })
- .then(this.loadVaults)
- .then(() => {
- this.setBusyCreate(false);
- })
- .catch((error) => {
- console.error('createVault', error);
- this.setBusyCreate(false);
- throw error;
- });
- }
-
- editVaultMeta () {
- this.setBusyMeta(true);
-
- return this._api.parity
- .setVaultMeta(this.vaultName, {
- description: this.vaultDescription,
- passwordHint: this.vaultPasswordHint,
- tags: this.vaultTags
- })
- .then(this.loadVaults)
- .then(() => {
- this.setBusyMeta(false);
- })
- .catch((error) => {
- console.error('editVaultMeta', error);
- this.setBusyMeta(false);
- throw error;
- });
- }
-
- editVaultPassword () {
- this.setBusyMeta(true);
-
- return this._api.parity
- .closeVault(this.vaultName)
- .then(() => {
- return this._api.parity.openVault(this.vaultName, this.vaultPasswordOld);
- })
- .then(() => {
- return this._api.parity.changeVaultPassword(this.vaultName, this.vaultPassword);
- })
- .then(() => {
- this.setBusyMeta(false);
- })
- .catch((error) => {
- console.error('editVaultPassword', error);
- this.loadVaults();
- this.setBusyMeta(false);
- throw new Error('Unable to change the vault password');
- });
- }
-
- openVault () {
- this.setBusyUnlock(true);
-
- return this._api.parity
- .openVault(this.vaultName, this.vaultPassword)
- .then(this.loadVaults)
- .then(() => {
- this.setBusyUnlock(false);
- })
- .catch((error) => {
- console.error('openVault', error);
- this.setBusyUnlock(false);
- throw error;
- });
- }
-
- moveAccounts (vaultName, inAccounts, outAccounts) {
- this.setBusyAccounts(true);
-
- return Promise
- .all([
- inAccounts.map((address) => this._api.parity.changeVault(address, vaultName)),
- outAccounts.map((address) => this._api.parity.changeVault(address, ''))
- ])
- .then(this.loadVaults)
- .then(() => {
- this.setBusyAccounts(false);
- })
- .catch((error) => {
- console.error('moveAccounts', error);
- this.setBusyAccounts(false);
- throw error;
- });
- }
-
- moveAccount (vaultName, address) {
- this.setBusyAccounts(true);
-
- return this._api.parity
- .changeVault(address, vaultName)
- .then(this.loadVaults)
- .then(() => {
- this.setBusyAccounts(false);
- })
- .catch((error) => {
- console.error('moveAccount', error);
- this.setBusyAccounts(false);
- throw error;
- });
- }
-
- static get (api) {
- if (!instance) {
- instance = new Store(api);
- }
-
- return instance;
- }
-}
diff --git a/js/packages/dapp-vaults/store.spec.js b/js/packages/dapp-vaults/store.spec.js
deleted file mode 100644
index 6ea36e82d..000000000
--- a/js/packages/dapp-vaults/store.spec.js
+++ /dev/null
@@ -1,686 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import sinon from 'sinon';
-
-import Vaults from './vaults';
-
-import ERRORS from '../dapp-accounts/CreateAccount/errors';
-import { createApi, TEST_VAULTS_ALL, TEST_VAULTS_META, TEST_VAULTS_OPEN } from './vaults.test.js';
-
-let api;
-let store;
-
-function create () {
- api = createApi();
- store = new Vaults.Store(api);
-
- return store;
-}
-
-describe('modals/Vaults/Store', () => {
- beforeEach(() => {
- create();
- });
-
- describe('@action', () => {
- describe('clearVaultFields', () => {
- beforeEach(() => {
- store.setVaultDescription('testing desc');
- store.setVaultName('testing 123');
- store.setVaultPassword('blah');
- store.setVaultPasswordRepeat('bleh');
- store.setVaultPasswordHint('hint');
- store.setVaultPasswordOld('old');
- store.setVaultTags('tags');
-
- store.clearVaultFields();
- });
-
- it('resets create fields', () => {
- expect(store.vaultDescription).to.equal('');
- expect(store.vaultName).to.equal('');
- expect(store.vaultNameError).not.to.be.null;
- expect(store.vaultPassword).to.equal('');
- expect(store.vaultPasswordRepeat).to.equal('');
- expect(store.vaultPasswordHint).to.equal('');
- expect(store.vaultPasswordOld).to.equal('');
- expect(store.vaultTags.length).to.equal(0);
- });
- });
-
- describe('setBusyAccounts', () => {
- it('sets the flag', () => {
- store.setBusyAccounts('busy');
-
- expect(store.isBusyAccounts).to.equal('busy');
- });
- });
-
- describe('setBusyCreate', () => {
- it('sets the flag', () => {
- store.setBusyCreate('busy');
-
- expect(store.isBusyCreate).to.equal('busy');
- });
- });
-
- describe('setBusyLoad', () => {
- it('sets the flag', () => {
- store.setBusyLoad('busy');
-
- expect(store.isBusyLoad).to.equal('busy');
- });
- });
-
- describe('setBusyLock', () => {
- it('sets the flag', () => {
- store.setBusyLock('busy');
-
- expect(store.isBusyLock).to.equal('busy');
- });
- });
-
- describe('setBusyMeta', () => {
- it('sets the flag', () => {
- store.setBusyMeta('busy');
-
- expect(store.isBusyMeta).to.equal('busy');
- });
- });
-
- describe('setBusyUnlock', () => {
- it('sets the flag', () => {
- store.setBusyUnlock('busy');
-
- expect(store.isBusyUnlock).to.equal('busy');
- });
- });
-
- describe('setModalAccountsOpen', () => {
- it('sets the flag', () => {
- store.setModalAccountsOpen('opened');
-
- expect(store.isModalAccountsOpen).to.equal('opened');
- });
- });
-
- describe('setModalCreateOpen', () => {
- it('sets the flag', () => {
- store.setModalCreateOpen('opened');
-
- expect(store.isModalCreateOpen).to.equal('opened');
- });
- });
-
- describe('setModalLockOpen', () => {
- it('sets the flag', () => {
- store.setModalLockOpen('opened');
-
- expect(store.isModalLockOpen).to.equal('opened');
- });
- });
-
- describe('setModalMetaOpen', () => {
- it('sets the flag', () => {
- store.setModalMetaOpen('opened');
-
- expect(store.isModalMetaOpen).to.equal('opened');
- });
- });
-
- describe('setModalUnlockOpen', () => {
- beforeEach(() => {
- store.setVaultPassword('testing');
- store.setModalUnlockOpen('opened');
- });
-
- it('sets the flag', () => {
- expect(store.isModalUnlockOpen).to.equal('opened');
- });
-
- it('rests the password to empty', () => {
- expect(store.vaultPassword).to.equal('');
- });
- });
-
- describe('setSelectedAccounts', () => {
- it('sets the selected accounts', () => {
- store.setSelectedAccounts('testing');
-
- expect(store.selectedAccounts).to.equal('testing');
- });
- });
-
- describe('setVaults', () => {
- beforeEach(() => {
- store.setVaults(['TEST', 'some'], ['TEST'], ['metaTest', 'metaSome']);
- });
-
- it('stores the available vault names (lookup)', () => {
- expect(store.vaultNames.peek()).to.deep.equal(['test', 'some']);
- });
-
- it('sets all vaults with correct flags', () => {
- expect(store.vaults.peek()).to.deep.equal([
- { name: 'TEST', meta: 'metaTest', isOpen: true },
- { name: 'some', meta: 'metaSome', isOpen: false }
- ]);
- });
-
- it('sets the opened vaults', () => {
- expect(store.vaultsOpened.peek()).to.deep.equal([
- { name: 'TEST', meta: 'metaTest', isOpen: true }
- ]);
- });
- });
-
- describe('setVaultDescription', () => {
- it('sets the description', () => {
- store.setVaultDescription('test');
-
- expect(store.vaultDescription).to.equal('test');
- });
- });
-
- describe('setVaultName', () => {
- it('sets the name as passed', () => {
- store.setVaultName('testing');
-
- expect(store.vaultName).to.equal('testing');
- });
-
- it('sets the vault when found', () => {
- store.setVaults(['testing'], [], ['meta']);
- store.setVaultName('testing');
-
- expect(store.vault).to.deep.equal({
- isOpen: false,
- meta: 'meta',
- name: 'testing'
- });
- });
-
- it('clears the vault when not found', () => {
- store.setVaults(['testing'], [], ['meta']);
- store.setVaultName('testing2');
-
- expect(store.vault).not.to.be.ok;
- });
-
- it('sets error noName error when empty', () => {
- store.setVaultName(null);
-
- expect(store.vaultNameError).to.equal(ERRORS.noName);
- });
-
- it('sets error duplicateName when duplicated', () => {
- store.setVaults(['testDupe'], [], ['testing']);
- store.setVaultName('testDUPE');
-
- expect(store.vaultNameError).to.equal(ERRORS.duplicateName);
- });
- });
-
- describe('setVaultPassword', () => {
- it('sets the password', () => {
- store.setVaultPassword('testPassword');
-
- expect(store.vaultPassword).to.equal('testPassword');
- });
- });
-
- describe('setVaultPasswordRepeat', () => {
- it('sets the password', () => {
- store.setVaultPasswordRepeat('testPassword');
-
- expect(store.vaultPasswordRepeat).to.equal('testPassword');
- });
- });
-
- describe('setVaultPasswordHint', () => {
- it('sets the password hint', () => {
- store.setVaultPasswordHint('test hint');
-
- expect(store.vaultPasswordHint).to.equal('test hint');
- });
- });
-
- describe('setVaultTags', () => {
- it('sets the tags', () => {
- store.setVaultTags('test');
-
- expect(store.vaultTags).to.equal('test');
- });
- });
-
- describe('toggleSelectedAccount', () => {
- beforeEach(() => {
- store.toggleSelectedAccount('123');
- });
-
- it('adds the selected account', () => {
- expect(store.selectedAccounts['123']).to.be.true;
- });
-
- it('reverses when toggled again', () => {
- store.toggleSelectedAccount('123');
- expect(store.selectedAccounts['123']).to.be.false;
- });
- });
- });
-
- describe('@computed', () => {
- describe('createPasswordRepeatError', () => {
- beforeEach(() => {
- store.setVaultPassword('blah');
- store.setVaultPasswordRepeat('bleh');
- });
-
- it('has error when passwords do not match', () => {
- expect(store.vaultPasswordRepeatError).not.to.be.null;
- });
-
- it('has no error when passwords match', () => {
- store.setVaultPasswordRepeat('blah');
- expect(store.vaultPasswordRepeatError).to.be.null;
- });
- });
- });
-
- describe('operations', () => {
- describe('closeAccountsModal', () => {
- beforeEach(() => {
- store.setModalAccountsOpen(true);
- store.closeAccountsModal();
- });
-
- it('sets the opened state to false', () => {
- expect(store.isModalAccountsOpen).to.be.false;
- });
- });
-
- describe('closeCreateModal', () => {
- beforeEach(() => {
- store.setModalCreateOpen(true);
- store.closeCreateModal();
- });
-
- it('sets the opened state to false', () => {
- expect(store.isModalCreateOpen).to.be.false;
- });
- });
-
- describe('closeLockModal', () => {
- beforeEach(() => {
- store.setModalLockOpen(true);
- store.closeLockModal();
- });
-
- it('sets the opened state to false', () => {
- expect(store.isModalLockOpen).to.be.false;
- });
- });
-
- describe('closeMetaModal', () => {
- beforeEach(() => {
- store.setModalMetaOpen(true);
- store.closeMetaModal();
- });
-
- it('sets the opened state to false', () => {
- expect(store.isModalMetaOpen).to.be.false;
- });
- });
-
- describe('closeUnlockModal', () => {
- beforeEach(() => {
- store.setModalUnlockOpen(true);
- store.closeUnlockModal();
- });
-
- it('sets the opened state to false', () => {
- expect(store.isModalUnlockOpen).to.be.false;
- });
- });
-
- describe('openAccountsModal', () => {
- beforeEach(() => {
- store.setSelectedAccounts({ '123': true, '456': false });
- store.openAccountsModal('testing');
- });
-
- it('sets the opened state to true', () => {
- expect(store.isModalAccountsOpen).to.be.true;
- });
-
- it('stores the name', () => {
- expect(store.vaultName).to.equal('testing');
- });
-
- it('empties the selectedAccounts', () => {
- expect(Object.keys(store.selectedAccounts).length).to.equal(0);
- });
- });
-
- describe('openCreateModal', () => {
- beforeEach(() => {
- sinon.spy(store, 'clearVaultFields');
- store.openCreateModal();
- });
-
- afterEach(() => {
- store.clearVaultFields.restore();
- });
-
- it('sets the opened state to true', () => {
- expect(store.isModalCreateOpen).to.be.true;
- });
-
- it('clears the create fields', () => {
- expect(store.clearVaultFields).to.have.been.called;
- });
- });
-
- describe('openLockModal', () => {
- beforeEach(() => {
- store.openLockModal('testing');
- });
-
- it('sets the opened state to true', () => {
- expect(store.isModalLockOpen).to.be.true;
- });
-
- it('stores the name', () => {
- expect(store.vaultName).to.equal('testing');
- });
- });
-
- describe('openMetaModal', () => {
- beforeEach(() => {
- store.openMetaModal('testing');
- });
-
- it('sets the opened state to true', () => {
- expect(store.isModalMetaOpen).to.be.true;
- });
-
- it('stores the name', () => {
- expect(store.vaultName).to.equal('testing');
- });
- });
-
- describe('openUnlockModal', () => {
- beforeEach(() => {
- store.openUnlockModal('testing');
- });
-
- it('sets the opened state to true', () => {
- expect(store.isModalUnlockOpen).to.be.true;
- });
-
- it('stores the name', () => {
- expect(store.vaultName).to.equal('testing');
- });
- });
-
- describe('loadVaults', () => {
- beforeEach(() => {
- sinon.spy(store, 'setBusyLoad');
- sinon.spy(store, 'setVaults');
-
- return store.loadVaults();
- });
-
- afterEach(() => {
- store.setBusyLoad.restore();
- store.setVaults.restore();
- });
-
- it('sets and resets the busy flag', () => {
- expect(store.setBusyLoad).to.have.been.calledWith(true);
- expect(store.isBusyLoad).to.be.false;
- });
-
- it('calls parity_listVaults', () => {
- expect(api.parity.listVaults).to.have.been.called;
- });
-
- it('calls parity_listOpenedVaults', () => {
- expect(api.parity.listOpenedVaults).to.have.been.called;
- });
-
- it('sets the vaults', () => {
- expect(store.setVaults).to.have.been.calledWith(TEST_VAULTS_ALL, TEST_VAULTS_OPEN, [
- TEST_VAULTS_META, TEST_VAULTS_META, TEST_VAULTS_META
- ]);
- });
- });
-
- describe('closeVault', () => {
- beforeEach(() => {
- sinon.spy(store, 'setBusyLock');
-
- store.setVaultName('testVault');
-
- return store.closeVault();
- });
-
- afterEach(() => {
- store.setBusyLock.restore();
- });
-
- it('sets and resets the busy flag', () => {
- expect(store.setBusyLock).to.have.been.calledWith(true);
- expect(store.isBusyLock).to.be.false;
- });
-
- it('calls into parity_closeVault', () => {
- expect(api.parity.closeVault).to.have.been.calledWith('testVault');
- });
- });
-
- describe('createVault', () => {
- beforeEach(() => {
- sinon.spy(store, 'setBusyCreate');
-
- store.setVaultDescription('testDescription');
- store.setVaultName('testCreateName');
- store.setVaultPassword('testCreatePassword');
- store.setVaultPasswordRepeat('testCreatePassword');
- store.setVaultPasswordHint('testCreateHint');
- store.setVaultTags('testTags');
-
- return store.createVault();
- });
-
- afterEach(() => {
- store.setBusyCreate.restore();
- });
-
- it('sets and resets the busy flag', () => {
- expect(store.setBusyCreate).to.have.been.calledWith(true);
- expect(store.isBusyCreate).to.be.false;
- });
-
- it('calls into parity_newVault', () => {
- expect(api.parity.newVault).to.have.been.calledWith('testCreateName', 'testCreatePassword');
- });
-
- it('calls into parity_setVaultMeta', () => {
- expect(api.parity.setVaultMeta).to.have.been.calledWith('testCreateName', {
- description: 'testDescription',
- passwordHint: 'testCreateHint',
- tags: 'testTags'
- });
- });
- });
-
- describe('editVaultMeta', () => {
- beforeEach(() => {
- sinon.spy(store, 'setBusyMeta');
-
- store.setVaultDescription('testDescription');
- store.setVaultName('testCreateName');
- store.setVaultPasswordHint('testCreateHint');
- store.setVaultTags('testTags');
-
- return store.editVaultMeta();
- });
-
- afterEach(() => {
- store.setBusyMeta.restore();
- });
-
- it('sets and resets the busy flag', () => {
- expect(store.setBusyMeta).to.have.been.calledWith(true);
- expect(store.isBusyMeta).to.be.false;
- });
-
- it('calls into parity_setVaultMeta', () => {
- expect(api.parity.setVaultMeta).to.have.been.calledWith('testCreateName', {
- description: 'testDescription',
- passwordHint: 'testCreateHint',
- tags: 'testTags'
- });
- });
- });
-
- describe('editVaultMeta', () => {
- beforeEach(() => {
- sinon.spy(store, 'setBusyMeta');
-
- store.setVaultDescription('testDescription');
- store.setVaultName('testCreateName');
- store.setVaultPasswordHint('testCreateHint');
- store.setVaultTags('testTags');
-
- return store.editVaultMeta();
- });
-
- afterEach(() => {
- store.setBusyMeta.restore();
- });
-
- it('sets and resets the busy flag', () => {
- expect(store.setBusyMeta).to.have.been.calledWith(true);
- expect(store.isBusyMeta).to.be.false;
- });
-
- it('calls into parity_setVaultMeta', () => {
- expect(api.parity.setVaultMeta).to.have.been.calledWith('testCreateName', {
- description: 'testDescription',
- passwordHint: 'testCreateHint',
- tags: 'testTags'
- });
- });
- });
-
- describe('editVaultPassword', () => {
- beforeEach(() => {
- sinon.spy(store, 'setBusyMeta');
-
- store.setVaultName('testName');
- store.setVaultPasswordOld('oldPassword');
- store.setVaultPassword('newPassword');
-
- return store.editVaultPassword();
- });
-
- afterEach(() => {
- store.setBusyMeta.restore();
- });
-
- it('sets and resets the busy flag', () => {
- expect(store.setBusyMeta).to.have.been.calledWith(true);
- expect(store.isBusyMeta).to.be.false;
- });
-
- it('calls into parity_openVault', () => {
- expect(api.parity.openVault).to.have.been.calledWith('testName', 'oldPassword');
- });
-
- it('calls into parity_changeVaultPassword', () => {
- expect(api.parity.changeVaultPassword).to.have.been.calledWith('testName', 'newPassword');
- });
- });
-
- describe('openVault', () => {
- beforeEach(() => {
- sinon.spy(store, 'setBusyUnlock');
-
- store.setVaultName('testVault');
-
- return store.openVault();
- });
-
- afterEach(() => {
- store.setBusyUnlock.restore();
- });
-
- it('sets and resets the busy flag', () => {
- expect(store.setBusyUnlock).to.have.been.calledWith(true);
- expect(store.isBusyUnlock).to.be.false;
- });
-
- it('calls into parity_openVault', () => {
- expect(api.parity.openVault).to.have.been.calledWith('testVault');
- });
- });
-
- describe('moveAccounts', () => {
- beforeEach(() => {
- sinon.spy(store, 'setBusyAccounts');
-
- return store.moveAccounts('testVault', ['A', 'B'], ['C']);
- });
-
- afterEach(() => {
- store.setBusyAccounts.restore();
- });
-
- it('sets the busy flag', () => {
- expect(store.setBusyAccounts).to.have.been.calledWith(true);
- });
-
- it('calls into parity_changeVault', () => {
- expect(api.parity.changeVault).to.have.been.calledWith('A', 'testVault');
- expect(api.parity.changeVault).to.have.been.calledWith('B', 'testVault');
- expect(api.parity.changeVault).to.have.been.calledWith('C', '');
- });
- });
-
- describe('moveAccount', () => {
- beforeEach(() => {
- sinon.spy(store, 'setBusyAccounts');
-
- return store.moveAccount('testVault', 'A');
- });
-
- afterEach(() => {
- store.setBusyAccounts.restore();
- });
-
- it('sets the busy flag', () => {
- expect(store.setBusyAccounts).to.have.been.calledWith(true);
- });
-
- it('calls into parity_changeVault', () => {
- expect(api.parity.changeVault).to.have.been.calledWith('A', 'testVault');
- });
- });
- });
-});
diff --git a/js/packages/dapp-vaults/vaults.css b/js/packages/dapp-vaults/vaults.css
deleted file mode 100644
index d73736773..000000000
--- a/js/packages/dapp-vaults/vaults.css
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.empty {
- width: 100%;
- display: block;
-
- span {
- color: #aaa;
- }
-}
diff --git a/js/packages/dapp-vaults/vaults.js b/js/packages/dapp-vaults/vaults.js
deleted file mode 100644
index 8df9a847f..000000000
--- a/js/packages/dapp-vaults/vaults.js
+++ /dev/null
@@ -1,223 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { observer } from 'mobx-react';
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-import { connect } from 'react-redux';
-
-import { Button, Container, Page, SectionList, VaultCard } from '@parity/ui';
-import { AccountsIcon, AddIcon, EditIcon, LockedIcon, UnlockedIcon } from '@parity/ui/Icons';
-
-import VaultAccounts from './VaultAccounts';
-import VaultCreate from './VaultCreate';
-import VaultLock from './VaultLock';
-import VaultMeta from './VaultMeta';
-import VaultUnlock from './VaultUnlock';
-
-import Store from './store';
-import styles from './vaults.css';
-
-@observer
-class Vaults extends Component {
- static contextTypes = {
- api: PropTypes.object.isRequired
- };
-
- static propTypes = {
- accounts: PropTypes.object.isRequired
- };
-
- static Store = Store;
-
- vaultStore = Store.get(this.context.api);
-
- componentWillMount () {
- return this.vaultStore.loadVaults();
- }
-
- render () {
- return (
- }
- key='create'
- label={
-
- }
- onClick={ this.onOpenCreate }
- />
- ] }
- title={
-
- }
- >
-
-
-
-
-
- { this.renderList() }
-
- );
- }
-
- renderList () {
- const { vaults } = this.vaultStore;
-
- if (!vaults || !vaults.length) {
- return (
-
-
-
- );
- }
-
- return (
-
- );
- }
-
- renderVault = (vault) => {
- const { accounts } = this.props;
- const { isOpen, name } = vault;
- const vaultAccounts = Object
- .keys(accounts)
- .filter((address) => accounts[address].uuid && accounts[address].meta.vault === vault.name);
-
- const onClickAccounts = () => {
- this.onOpenAccounts(name);
- return false;
- };
- const onClickEdit = () => {
- this.onOpenEdit(name);
- return false;
- };
- const onClickOpen = () => {
- isOpen
- ? this.onOpenLockVault(name)
- : this.onOpenUnlockVault(name);
- return false;
- };
-
- return (
- }
- key='accounts'
- label={
-
- }
- onClick={ onClickAccounts }
- />,
- }
- key='edit'
- label={
-
- }
- onClick={ onClickEdit }
- />,
- }
- key='close'
- label={
-
- }
- onClick={ onClickOpen }
- />
- ]
- : [
- }
- key='open'
- label={
-
- }
- onClick={ onClickOpen }
- />
- ]
- }
- vault={ vault }
- />
- );
- }
-
- onOpenAccounts = (name) => {
- this.vaultStore.openAccountsModal(name);
- }
-
- onOpenCreate = () => {
- this.vaultStore.openCreateModal();
- }
-
- onOpenEdit = (name) => {
- this.vaultStore.openMetaModal(name);
- }
-
- onOpenLockVault = (name) => {
- this.vaultStore.openLockModal(name);
- }
-
- onOpenMeta = (name) => {
- this.vaultStore.openMetaModal(name);
- }
-
- onOpenUnlockVault = (name) => {
- this.vaultStore.openUnlockModal(name);
- }
-}
-
-function mapStateToProps (state) {
- const { accounts } = state.personal;
-
- return { accounts };
-}
-
-export default connect(
- mapStateToProps,
- null
-)(Vaults);
diff --git a/js/packages/dapp-vaults/vaults.spec.js b/js/packages/dapp-vaults/vaults.spec.js
deleted file mode 100644
index 4748f91bd..000000000
--- a/js/packages/dapp-vaults/vaults.spec.js
+++ /dev/null
@@ -1,201 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { shallow } from 'enzyme';
-import React from 'react';
-import sinon from 'sinon';
-
-import { createApi, createReduxStore } from './vaults.test.js';
-
-import Vaults from './vaults';
-
-let api;
-let component;
-let instance;
-let store;
-
-function render (props = {}) {
- api = createApi();
- store = createReduxStore();
-
- component = shallow(
- ,
- {
- context: { store }
- }
- ).find('Vaults').shallow({ context: { api } });
- instance = component.instance();
-
- return component;
-}
-
-describe('views/Vaults', () => {
- beforeEach(() => {
- render();
- });
-
- it('renders defaults', () => {
- expect(component).to.be.ok;
- });
-
- describe('instance methods', () => {
- describe('componentWillMount', () => {
- beforeEach(() => {
- sinon.spy(instance.vaultStore, 'loadVaults');
-
- return instance.componentWillMount();
- });
-
- afterEach(() => {
- instance.vaultStore.loadVaults.restore();
- });
-
- it('calls into vaultStore.loadVaults', () => {
- expect(instance.vaultStore.loadVaults).to.have.been.called;
- });
- });
-
- describe('renderList', () => {
- it('renders empty when no vaults', () => {
- instance.vaultStore.setVaults([], [], []);
-
- expect(
- shallow(instance.renderList()).find('FormattedMessage').props().id
- ).to.equal('vaults.empty');
- });
-
- describe('SectionList', () => {
- let list;
-
- beforeEach(() => {
- instance.vaultStore.setVaults(['testing'], [], ['meta']);
- list = instance.renderList();
- });
-
- it('renders', () => {
- expect(list).to.ok;
- });
-
- it('passes the vaults', () => {
- expect(list.props.items.peek()).to.deep.equal(instance.vaultStore.vaults.peek());
- });
-
- it('renders via renderItem', () => {
- expect(list.props.renderItem).to.deep.equal(instance.renderVault);
- });
- });
- });
-
- describe('renderVault', () => {
- const VAULT = { name: 'testing', isOpen: true, meta: 'meta' };
- let card;
-
- beforeEach(() => {
- card = instance.renderVault(VAULT);
- });
-
- it('renders', () => {
- expect(card).to.be.ok;
- });
-
- it('passes the vault', () => {
- expect(card.props.vault).to.deep.equal(VAULT);
- });
- });
- });
-
- describe('event methods', () => {
- describe('onOpenAccounts', () => {
- beforeEach(() => {
- sinon.spy(instance.vaultStore, 'openAccountsModal');
-
- instance.onOpenAccounts('testing');
- });
-
- afterEach(() => {
- instance.vaultStore.openAccountsModal.restore();
- });
-
- it('calls into vaultStore.openAccountsModal', () => {
- expect(instance.vaultStore.openAccountsModal).to.have.been.calledWith('testing');
- });
- });
-
- describe('onOpenCreate', () => {
- beforeEach(() => {
- sinon.spy(instance.vaultStore, 'openCreateModal');
-
- instance.onOpenCreate();
- });
-
- afterEach(() => {
- instance.vaultStore.openCreateModal.restore();
- });
-
- it('calls into vaultStore.openCreateModal', () => {
- expect(instance.vaultStore.openCreateModal).to.have.been.called;
- });
- });
-
- describe('onOpenEdit', () => {
- beforeEach(() => {
- sinon.spy(instance.vaultStore, 'openMetaModal');
-
- instance.onOpenEdit('testing');
- });
-
- afterEach(() => {
- instance.vaultStore.openMetaModal.restore();
- });
-
- it('calls into vaultStore.openMetaModal', () => {
- expect(instance.vaultStore.openMetaModal).to.have.been.calledWith('testing');
- });
- });
-
- describe('onOpenLockVault', () => {
- beforeEach(() => {
- sinon.spy(instance.vaultStore, 'openLockModal');
-
- instance.onOpenLockVault('testing');
- });
-
- afterEach(() => {
- instance.vaultStore.openLockModal.restore();
- });
-
- it('calls into vaultStore.openLockModal', () => {
- expect(instance.vaultStore.openLockModal).to.have.been.calledWith('testing');
- });
- });
-
- describe('onOpenUnlockVault', () => {
- beforeEach(() => {
- sinon.spy(instance.vaultStore, 'openUnlockModal');
-
- instance.onOpenUnlockVault('testing');
- });
-
- afterEach(() => {
- instance.vaultStore.openUnlockModal.restore();
- });
-
- it('calls into vaultStore.openUnlockModal', () => {
- expect(instance.vaultStore.openUnlockModal).to.have.been.calledWith('testing');
- });
- });
- });
-});
diff --git a/js/packages/dapp-vaults/vaults.test.js b/js/packages/dapp-vaults/vaults.test.js
deleted file mode 100644
index 47cae8f84..000000000
--- a/js/packages/dapp-vaults/vaults.test.js
+++ /dev/null
@@ -1,91 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import sinon from 'sinon';
-
-const ACCOUNT_A = '0x1234567890123456789012345678901234567890';
-const ACCOUNT_B = '0x0123456789012345678901234567890123456789';
-const ACCOUNT_C = '0x9012345678901234567890123456789012345678';
-const ACCOUNT_D = '0x8901234567890123456789012345678901234567';
-
-const TEST_VAULTS_ALL = ['vault1', 'vault2', 'vault3'];
-const TEST_VAULTS_OPEN = ['vault2'];
-const TEST_VAULTS_META = { something: 'test' };
-
-const TEST_ACCOUNTS = {
- [ACCOUNT_A]: {
- address: ACCOUNT_A,
- uuid: null
- },
- [ACCOUNT_B]: {
- address: ACCOUNT_B,
- uuid: ACCOUNT_B,
- meta: {
- vault: 'somethingElse'
- }
- },
- [ACCOUNT_C]: {
- address: ACCOUNT_C,
- uuid: ACCOUNT_C,
- meta: {
- vault: 'test'
- }
- },
- [ACCOUNT_D]: {
- address: ACCOUNT_D,
- uuid: ACCOUNT_D,
- meta: {
- vault: 'test'
- }
- }
-};
-
-export function createApi () {
- return {
- parity: {
- listOpenedVaults: sinon.stub().resolves(TEST_VAULTS_OPEN),
- listVaults: sinon.stub().resolves(TEST_VAULTS_ALL),
- changeVault: sinon.stub().resolves(true),
- closeVault: sinon.stub().resolves(true),
- getVaultMeta: sinon.stub().resolves(TEST_VAULTS_META),
- newVault: sinon.stub().resolves(true),
- openVault: sinon.stub().resolves(true),
- setVaultMeta: sinon.stub().resolves(true),
- changeVaultPassword: sinon.stub().resolves(true)
- }
- };
-}
-
-export function createReduxStore () {
- return {
- dispatch: sinon.stub(),
- subscribe: sinon.stub(),
- getState: () => {
- return {
- personal: {
- accounts: TEST_ACCOUNTS
- }
- };
- }
- };
-}
-
-export {
- TEST_ACCOUNTS,
- TEST_VAULTS_ALL,
- TEST_VAULTS_META,
- TEST_VAULTS_OPEN
-};
diff --git a/js/packages/dapp-wallet/Confirmations/confirmations.js b/js/packages/dapp-wallet/Confirmations/confirmations.js
deleted file mode 100644
index fa3e6aafc..000000000
--- a/js/packages/dapp-wallet/Confirmations/confirmations.js
+++ /dev/null
@@ -1,364 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-import ReactTooltip from 'react-tooltip';
-import { connect } from 'react-redux';
-import { bindActionCreators } from 'redux';
-
-import { bytesToHex } from '@parity/api/util/format';
-import { confirmOperation, revokeOperation } from '@parity/shared/redux/providers/walletActions';
-import { Container, Dropdown, InputAddress, IdentityIcon, Progress } from '@parity/ui';
-import TxRow from '@parity/ui/TxList/TxRow';
-
-import styles from '../wallet.css';
-import txListStyles from '@parity/ui/TxList/txList.css';
-
-class WalletConfirmations extends Component {
- static contextTypes = {
- api: PropTypes.object.isRequired
- };
-
- static propTypes = {
- accounts: PropTypes.object.isRequired,
- address: PropTypes.string.isRequired,
- netVersion: PropTypes.string.isRequired,
- owners: PropTypes.array.isRequired,
- require: PropTypes.object.isRequired,
- confirmOperation: PropTypes.func.isRequired,
- revokeOperation: PropTypes.func.isRequired,
-
- confirmations: PropTypes.array
- };
-
- static defaultProps = {
- confirmations: []
- };
-
- render () {
- return (
-
- );
- }
-}
diff --git a/js/packages/dapp-wallet/Confirmations/index.js b/js/packages/dapp-wallet/Confirmations/index.js
deleted file mode 100644
index fc1c3be1a..000000000
--- a/js/packages/dapp-wallet/Confirmations/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './confirmations';
diff --git a/js/packages/dapp-wallet/Details/details.js b/js/packages/dapp-wallet/Details/details.js
deleted file mode 100644
index 063ad5c58..000000000
--- a/js/packages/dapp-wallet/Details/details.js
+++ /dev/null
@@ -1,121 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-
-import { Container, InputAddress } from '@parity/ui';
-
-import styles from '../wallet.css';
-
-export default class WalletDetails extends Component {
- static contextTypes = {
- api: PropTypes.object.isRequired
- };
-
- static propTypes = {
- owners: PropTypes.array,
- require: PropTypes.object,
- className: PropTypes.string
- };
-
- static defaultProps = {
- className: ''
- };
-
- render () {
- const { className } = this.props;
-
- return (
-
- );
- }
-}
diff --git a/js/packages/dapp-wallet/Details/index.js b/js/packages/dapp-wallet/Details/index.js
deleted file mode 100644
index b5dd07dd5..000000000
--- a/js/packages/dapp-wallet/Details/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './details';
diff --git a/js/packages/dapp-wallet/Transactions/index.js b/js/packages/dapp-wallet/Transactions/index.js
deleted file mode 100644
index 0ba7422c9..000000000
--- a/js/packages/dapp-wallet/Transactions/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './transactions';
diff --git a/js/packages/dapp-wallet/Transactions/transactions.js b/js/packages/dapp-wallet/Transactions/transactions.js
deleted file mode 100644
index f5e14bf10..000000000
--- a/js/packages/dapp-wallet/Transactions/transactions.js
+++ /dev/null
@@ -1,98 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-
-import { bytesToHex } from '@parity/api/util/format';
-import { Container } from '@parity/ui';
-import TxRow from '@parity/ui/TxList/TxRow';
-import txListStyles from '@parity/ui/TxList/txList.css';
-
-export default class WalletTransactions extends Component {
- static propTypes = {
- address: PropTypes.string.isRequired,
- netVersion: PropTypes.string.isRequired,
- transactions: PropTypes.array
- };
-
- static defaultProps = {
- transactions: []
- };
-
- render () {
- return (
-
- );
- }
-}
diff --git a/js/packages/dapp-wallet/WalletSettings/index.js b/js/packages/dapp-wallet/WalletSettings/index.js
deleted file mode 100644
index bfedbb7af..000000000
--- a/js/packages/dapp-wallet/WalletSettings/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './walletSettings';
diff --git a/js/packages/dapp-wallet/WalletSettings/walletSettings.css b/js/packages/dapp-wallet/WalletSettings/walletSettings.css
deleted file mode 100644
index 6b087083e..000000000
--- a/js/packages/dapp-wallet/WalletSettings/walletSettings.css
+++ /dev/null
@@ -1,68 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-.splitInput {
- display: flex;
- flex-direction: row;
-
- > * {
- flex: 1;
-
- margin: 0 0.25em;
-
- &:first-child {
- margin-left: 0;
- }
-
- &:last-child {
- margin-right: 0;
- }
- }
-}
-
-.change {
- background-color: rgba(255, 255, 255, 0.1);
- padding: 0.75em 1.75em;
- margin-bottom: 1em;
-
- &.add {
- background-color: rgba(139, 195, 74, 0.5);
- }
-
- &.remove {
- background-color: rgba(244, 67, 54, 0.5);
- }
-
- .label {
- text-transform: uppercase;
- margin-bottom: 0.5em;
- margin-left: -1em;
- font-size: 0.8em;
- }
-}
-
-.eth:after {
- content: 'ETH';
- font-size: 0.75em;
- margin-left: 0.125em;
-}
-
-.modifications {
- color: white;
- margin: 0;
-}
-
diff --git a/js/packages/dapp-wallet/WalletSettings/walletSettings.js b/js/packages/dapp-wallet/WalletSettings/walletSettings.js
deleted file mode 100644
index f226efbfa..000000000
--- a/js/packages/dapp-wallet/WalletSettings/walletSettings.js
+++ /dev/null
@@ -1,460 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-import { connect } from 'react-redux';
-import { observer } from 'mobx-react';
-import { pick } from 'lodash';
-
-import { fromWei } from '@parity/api/util/wei';
-import { AddressSelect, Button, Form, TypedInput, Input, InputAddress, Portal } from '@parity/ui';
-import { CancelIcon, NextIcon } from '@parity/ui/Icons';
-
-import WalletSettingsStore from './walletSettingsStore.js';
-import styles from './walletSettings.css';
-
-@observer
-class WalletSettings extends Component {
- static contextTypes = {
- api: PropTypes.object.isRequired
- };
-
- static propTypes = {
- accountsInfo: PropTypes.object.isRequired,
- wallet: PropTypes.object.isRequired,
- onClose: PropTypes.func.isRequired,
- senders: PropTypes.object.isRequired
- };
-
- store = new WalletSettingsStore(this.context.api, this.props);
-
- render () {
- const { stage, steps } = this.store;
-
- return (
- step.title) }
- >
- { this.renderPage() }
-
- );
- }
-
- renderPage () {
- const { step } = this.store;
-
- switch (step) {
- case 'CONFIRMATION':
- const { changes } = this.store;
-
- return (
-
- );
- }
-
- return [
- ,
-
-
- ];
- }
-
- renderActionbar () {
- const { owned } = this.props;
-
- const buttons = [];
-
- if (owned) {
- buttons.push(
- }
- key='transferFunds'
- label={
-
- }
- onClick={ this.onTransferClick }
- />
- );
- }
-
- buttons.push(
- }
- key='delete'
- label={
-
- }
- onClick={ this.showDeleteDialog }
- />
- );
-
- buttons.push(
- }
- key='editmeta'
- label={
-
- }
- onClick={ this.onEditClick }
- />
- );
-
- if (owned) {
- buttons.push(
- }
- key='settings'
- label={
-
- }
- onClick={ this.onSettingsClick }
- />
- );
- }
-
- return (
-
- }
- />
- );
- }
-
- renderDeleteDialog (account) {
- const { showDeleteDialog } = this.state;
-
- return (
-
- );
- }
-
- renderEditDialog (wallet) {
- const { showEditDialog } = this.state;
-
- if (!showEditDialog) {
- return null;
- }
-
- return (
-
- );
- }
-
- renderSettingsDialog () {
- const { wallet } = this.props;
- const { showSettingsDialog } = this.state;
-
- if (!showSettingsDialog) {
- return null;
- }
-
- return (
-
- );
- }
-
- renderTransferDialog () {
- const { showTransferDialog } = this.state;
-
- if (!showTransferDialog) {
- return null;
- }
-
- const { walletAccount } = this.props;
-
- return (
-
- );
- }
-
- onEditClick = () => {
- this.setState({
- showEditDialog: !this.state.showEditDialog
- });
- }
-
- onSettingsClick = () => {
- this.setState({
- showSettingsDialog: !this.state.showSettingsDialog
- });
- }
-
- onTransferClick = () => {
- this.setState({
- showTransferDialog: !this.state.showTransferDialog
- });
- }
-
- onTransferClose = () => {
- this.onTransferClick();
- }
-
- closeDeleteDialog = () => {
- this.setState({ showDeleteDialog: false });
- }
-
- showDeleteDialog = () => {
- this.setState({ showDeleteDialog: true });
- }
-}
-
-function mapStateToProps (_, initProps) {
- const { address } = initProps.params;
-
- return (state) => {
- const { netVersion } = state.nodeStatus;
- const { accountsInfo = {}, accounts = {} } = state.personal;
- const walletAccount = accounts[address] || accountsInfo[address] || null;
-
- if (walletAccount) {
- walletAccount.address = address;
- }
-
- const wallet = state.wallet.wallets[address] || {};
- const owned = !!accounts[address];
-
- return {
- address,
- netVersion,
- owned,
- wallet,
- walletAccount
- };
- };
-}
-
-function mapDispatchToProps (dispatch) {
- return bindActionCreators({
- setVisibleAccounts
- }, dispatch);
-}
-
-export default connect(
- mapStateToProps,
- mapDispatchToProps
-)(Wallet);
diff --git a/js/packages/dapp-web/AddressBar/addressBar.js b/js/packages/dapp-web/AddressBar/addressBar.js
deleted file mode 100644
index b529d2278..000000000
--- a/js/packages/dapp-web/AddressBar/addressBar.js
+++ /dev/null
@@ -1,75 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { observer } from 'mobx-react';
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-
-import { Button, DappUrlInput } from '@parity/ui';
-import { CloseIcon, RefreshIcon, GotoIcon } from '@parity/ui/Icons';
-
-@observer
-export default class AddressBar extends Component {
- static propTypes = {
- className: PropTypes.string,
- store: PropTypes.object.isRequired
- };
-
- render () {
- const { isLoading, isPristine, nextUrl } = this.props.store;
-
- return (
-
-
- :
- }
- />
-
- }
- />
-
- );
- }
-
- onRefreshUrl = () => {
- this.props.store.reload();
- }
-
- onChangeUrl = (url) => {
- this.props.store.setNextUrl(url);
- }
-
- onGotoUrl = () => {
- this.props.store.gotoUrl();
- }
-
- onRestoreUrl = () => {
- this.props.store.restoreUrl();
- }
-}
diff --git a/js/packages/dapp-web/AddressBar/addressBar.spec.js b/js/packages/dapp-web/AddressBar/addressBar.spec.js
deleted file mode 100644
index 7208d0f7b..000000000
--- a/js/packages/dapp-web/AddressBar/addressBar.spec.js
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { shallow } from 'enzyme';
-import React from 'react';
-
-import AddressBar from './';
-
-let component;
-let store;
-
-function createStore () {
- store = {
- nextUrl: 'https://parity.io'
- };
-
- return store;
-}
-
-function render (props = {}) {
- component = shallow(
-
- );
-
- return component;
-}
-
-describe('views/Web/AddressBar', () => {
- it('renders defaults', () => {
- expect(render()).to.be.ok;
- });
-});
diff --git a/js/packages/dapp-web/AddressBar/index.js b/js/packages/dapp-web/AddressBar/index.js
deleted file mode 100644
index 9d0cce3a0..000000000
--- a/js/packages/dapp-web/AddressBar/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './addressBar';
diff --git a/js/packages/dapp-web/api.js b/js/packages/dapp-web/api.js
deleted file mode 100644
index 742386288..000000000
--- a/js/packages/dapp-web/api.js
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import Api from '@parity/api';
-
-const ethereumProvider = window.ethereum || window.parent.ethereum;
-
-if (!ethereumProvider) {
- throw new Error('Unable to locate EthereumProvider, object not attached');
-}
-
-const api = new Api(ethereumProvider);
-
-export {
- api
-};
diff --git a/js/packages/dapp-web/dapplink.js b/js/packages/dapp-web/dapplink.js
deleted file mode 100644
index e03ed0d02..000000000
--- a/js/packages/dapp-web/dapplink.js
+++ /dev/null
@@ -1,62 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import base32 from 'base32.js';
-
-import { DOMAIN } from '@parity/shared/util/constants';
-
-const BASE_URL = `.web${DOMAIN}`;
-const ENCODER_OPTS = { type: 'crockford' };
-
-export function encodePath (token, url) {
- const encoder = new base32.Encoder(ENCODER_OPTS);
- const chars = `${token}+${url}`
- .split('')
- .map((char) => char.charCodeAt(0));
-
- return encoder
- .write(chars) // add the characters to encode
- .finalize(); // create the encoded string
-}
-
-export function encodeUrl (token, url) {
- const encoded = encodePath(token, url)
- .match(/.{1,63}/g) // split into 63-character chunks, max length is 64 for URLs parts
- .join('.'); // add '.' between URL parts
-
- return `${encoded}${BASE_URL}`;
-}
-
-// TODO: This export is really more a helper along the way of verifying the actual
-// encoding (being able to decode test values from the node layer), than meant to
-// be used as-is. Should the need arrise to decode URLs as well (instead of just
-// producing), it would make sense to further split the output into the token/URL
-export function decode (encoded) {
- const decoder = new base32.Decoder(ENCODER_OPTS);
- const sanitized = encoded
- .replace(BASE_URL, '') // remove the BASE URL
- .split('.') // split the string on the '.' (63-char boundaries)
- .join(''); // combine without the '.'
-
- return decoder
- .write(sanitized) // add the string to decode
- .finalize() // create the decoded buffer
- .toString(); // create string from buffer
-}
-
-export {
- BASE_URL
-};
diff --git a/js/packages/dapp-web/dapplink.spec.js b/js/packages/dapp-web/dapplink.spec.js
deleted file mode 100644
index 49a3aa197..000000000
--- a/js/packages/dapp-web/dapplink.spec.js
+++ /dev/null
@@ -1,83 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { BASE_URL, decode, encodePath, encodeUrl } from './dapplink';
-
-const TEST_TOKEN = 'token';
-const TEST_URL = 'https://parity.io';
-const TEST_URL_LONG = 'http://some.very.very.very.long.long.long.domain.example.com';
-const TEST_PREFIX = 'EHQPPSBE5DM78X3GECX2YBVGC5S6JX3S5SMPY';
-const TEST_PREFIX_LONG = [
- 'EHQPPSBE5DM78X3G78QJYWVFDNJJWXK5E9WJWXK5E9WJWXK5E9WJWV3FDSKJWV3', 'FDSKJWV3FDSKJWS3FDNGPJVHECNW62VBGDHJJWRVFDM'
-].join('.');
-const TEST_RESULT = `${TEST_PREFIX}${BASE_URL}`;
-const TEST_ENCODED = `${TEST_TOKEN}+${TEST_URL}`;
-
-describe('util/ethlink', () => {
- describe('decode', () => {
- it('decodes into encoded url', () => {
- expect(decode(TEST_PREFIX)).to.equal(TEST_ENCODED);
- });
-
- it('decodes full into encoded url', () => {
- expect(decode(TEST_RESULT)).to.equal(TEST_ENCODED);
- });
- });
-
- describe('encodePath', () => {
- it('encodes a url/token combination', () => {
- expect(encodePath(TEST_TOKEN, TEST_URL)).to.equal(TEST_PREFIX);
- });
-
- it('changes when token changes', () => {
- expect(encodePath('test-token-2', TEST_URL)).not.to.equal(TEST_PREFIX);
- });
-
- it('changes when url changes', () => {
- expect(encodePath(TEST_TOKEN, 'http://other.example.com')).not.to.equal(TEST_PREFIX);
- });
- });
-
- describe('encodeUrl', () => {
- it('encodes a url/token combination', () => {
- expect(encodeUrl(TEST_TOKEN, TEST_URL)).to.equal(TEST_RESULT);
- });
-
- it('changes when token changes', () => {
- expect(encodeUrl('test-token-2', TEST_URL)).not.to.equal(TEST_RESULT);
- });
-
- it('changes when url changes', () => {
- expect(encodeUrl(TEST_TOKEN, 'http://other.example.com')).not.to.equal(TEST_RESULT);
- });
-
- describe('splitting', () => {
- let encoded;
-
- beforeEach(() => {
- encoded = encodeUrl(TEST_TOKEN, TEST_URL_LONG);
- });
-
- it('splits long values into boundary parts', () => {
- expect(encoded).to.equal(`${TEST_PREFIX_LONG}${BASE_URL}`);
- });
-
- it('first part 63 characters', () => {
- expect(encoded.split('.')[0].length).to.equal(63);
- });
- });
- });
-});
diff --git a/js/packages/dapp-web/index.js b/js/packages/dapp-web/index.js
deleted file mode 100644
index aa42f0220..000000000
--- a/js/packages/dapp-web/index.js
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import ReactDOM from 'react-dom';
-import React from 'react';
-import { Route, Router, hashHistory } from 'react-router';
-
-import injectTapEventPlugin from 'react-tap-event-plugin';
-injectTapEventPlugin();
-
-import { initStore } from '@parity/shared/redux';
-import ContextProvider from '@parity/ui/ContextProvider';
-
-import api from './api';
-import Web from './web';
-
-const store = initStore(api, hashHistory);
-
-ReactDOM.render(
-
-
-
-
- ,
- document.querySelector('#container')
-);
diff --git a/js/packages/dapp-web/package.json b/js/packages/dapp-web/package.json
deleted file mode 100644
index ed211a512..000000000
--- a/js/packages/dapp-web/package.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "name": "@parity/dapp-web",
- "description": "Parity web application view",
- "version": "1.99.99",
- "main": "index.js",
- "author": "Parity Team ",
- "maintainers": [],
- "contributors": [],
- "license": "GPL-3.0",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/paritytech/dapp-web.git"
- },
- "keywords": [],
- "scripts": {},
- "devDependencies": {},
- "dependencies": {},
- "peerDependencies": {}
-}
diff --git a/js/packages/dapp-web/store.js b/js/packages/dapp-web/store.js
deleted file mode 100644
index 99a8eee11..000000000
--- a/js/packages/dapp-web/store.js
+++ /dev/null
@@ -1,183 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { action, computed, observable, transaction } from 'mobx';
-import localStore from 'store';
-import { parse as parseUrl } from 'url';
-
-import { encodePath, encodeUrl } from './dapplink';
-
-const DEFAULT_URL = 'https://oasisdex.com';
-const LS_LAST_ADDRESS = '_parity::webLastAddress';
-
-const hasProtocol = /^https?:\/\//;
-
-let instance = null;
-
-export default class Store {
- @observable counter = Date.now();
- @observable currentUrl = null;
- @observable history = [];
- @observable isLoading = false;
- @observable parsedUrl = null;
- @observable nextUrl = null;
- @observable token = null;
-
- constructor (api) {
- this._api = api;
-
- this.nextUrl = this.currentUrl = this.loadLastUrl();
- }
-
- @computed get encodedPath () {
- return `${this._api.dappsUrl}/web/${encodePath(this.token, this.currentUrl)}?t=${this.counter}`;
- }
-
- @computed get encodedUrl () {
- return `http://${encodeUrl(this.token, this.currentUrl)}:${this._api.dappsPort}?t=${this.counter}`;
- }
-
- @computed get frameId () {
- return `_web_iframe_${this.counter}`;
- }
-
- @computed get isPristine () {
- return this.currentUrl === this.nextUrl;
- }
-
- @action gotoUrl = (_url) => {
- let url = (_url || this.nextUrl).trim().replace(/\/+$/, '');
-
- if (!hasProtocol.test(url)) {
- url = `https://${url}`;
- }
-
- return this.generateToken(url).then(() => {
- transaction(() => {
- this.setNextUrl(url);
- this.setCurrentUrl(this.nextUrl);
- });
- });
- }
-
- @action reload = () => {
- transaction(() => {
- this.setLoading(true);
- this.counter = Date.now();
- });
- }
-
- @action restoreUrl = () => {
- this.setNextUrl(this.currentUrl);
- }
-
- @action setHistory = (urls) => {
- this.history = Object
- .keys(urls)
- .filter((url) => url && !url.startsWith(this._api.dappsUrl) && url.indexOf('127.0.0.1') === -1)
- .sort((urlA, urlB) => {
- const timeA = urls[urlA].getTime();
- const timeB = urls[urlB].getTime();
-
- if (timeA > timeB) {
- return -1;
- } else if (timeA < timeB) {
- return 1;
- }
-
- return 0;
- })
- .map((url) => {
- const hostname = url.replace(/^http[s]?:\/\//, '').split('/')[0];
-
- return {
- hostname,
- timestamp: urls[url],
- url
- };
- });
- }
-
- @action setLoading = (isLoading) => {
- this.isLoading = isLoading;
- }
-
- @action setToken = (token) => {
- this.token = token;
- }
-
- @action setCurrentUrl = (_url) => {
- const url = _url || this.currentUrl;
-
- transaction(() => {
- this.currentUrl = url;
- this.parsedUrl = parseUrl(url);
-
- this.saveLastUrl();
-
- this.reload();
- });
- }
-
- @action setNextUrl = (url) => {
- this.nextUrl = url;
- }
-
- generateToken = (_url) => {
- this.setToken(null);
-
- return this._api.signer
- .generateWebProxyAccessToken(_url)
- .then((token) => {
- this.setToken(token);
- })
- .catch((error) => {
- console.warn('generateToken', error);
- });
- }
-
- loadHistory = () => {
- return this._api.parity
- .listRecentDapps()
- .then((apps) => {
- this.setHistory(apps);
- })
- .catch((error) => {
- console.warn('loadHistory', error);
- });
- }
-
- loadLastUrl = () => {
- return localStore.get(LS_LAST_ADDRESS) || DEFAULT_URL;
- }
-
- saveLastUrl = () => {
- return localStore.set(LS_LAST_ADDRESS, this.currentUrl);
- }
-
- static get (api) {
- if (!instance) {
- instance = new Store(api);
- }
-
- return instance;
- }
-}
-
-export {
- DEFAULT_URL,
- LS_LAST_ADDRESS
-};
diff --git a/js/packages/dapp-web/store.spec.js b/js/packages/dapp-web/store.spec.js
deleted file mode 100644
index 8e92cbd01..000000000
--- a/js/packages/dapp-web/store.spec.js
+++ /dev/null
@@ -1,228 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import sinon from 'sinon';
-
-import Store from './store';
-
-const TEST_HISTORY_URLA = 'http://testingA';
-const TEST_HISTORY_URLB = 'http://testingB';
-const TEST_HISTORY = {
- '': new Date(678),
- [TEST_HISTORY_URLA]: new Date(123),
- [TEST_HISTORY_URLB]: new Date(456)
-};
-const TEST_TOKEN = 'testing-123';
-const TEST_URL1 = 'http://some.test.domain.com';
-const TEST_URL2 = 'http://something.different.com';
-
-let api;
-let store;
-
-function createApi () {
- api = {
- dappsPort: 8545,
- dappsUrl: 'http://home.web3.site:8545',
- parity: {
- listRecentDapps: sinon.stub().resolves(TEST_HISTORY)
- },
- signer: {
- generateWebProxyAccessToken: sinon.stub().resolves(TEST_TOKEN)
- }
- };
-
- return api;
-}
-
-function create () {
- store = new Store(createApi());
-
- return store;
-}
-
-describe('views/Web/Store', () => {
- beforeEach(() => {
- create();
- });
-
- describe('@action', () => {
- describe('gotoUrl', () => {
- it('uses the nextUrl when none specified', () => {
- store.setNextUrl('https://parity.io');
-
- return store.gotoUrl().then(() => {
- expect(store.currentUrl).to.equal('https://parity.io');
- });
- });
-
- it('adds https when no protocol', () => {
- return store.gotoUrl('google.com').then(() => {
- expect(store.currentUrl).to.equal('https://google.com');
- });
- });
- });
-
- describe('restoreUrl', () => {
- it('sets the nextUrl to the currentUrl', () => {
- store.setCurrentUrl(TEST_URL1);
- store.setNextUrl(TEST_URL2);
- store.restoreUrl();
-
- expect(store.nextUrl).to.equal(TEST_URL1);
- });
- });
-
- describe('setCurrentUrl', () => {
- beforeEach(() => {
- store.setCurrentUrl(TEST_URL1);
- });
-
- it('sets the url', () => {
- expect(store.currentUrl).to.equal(TEST_URL1);
- });
- });
-
- describe('setHistory', () => {
- let history;
-
- beforeEach(() => {
- store.setHistory(TEST_HISTORY);
- history = store.history.peek();
- });
-
- it('sets the history', () => {
- expect(history.length).to.equal(2);
- });
-
- it('adds hostname to entries', () => {
- expect(history[1].hostname).to.be.ok;
- });
-
- it('removes hostname http prefixes', () => {
- expect(history[1].hostname.indexOf('http')).to.equal(-1);
- });
-
- it('sorts the entries according to recently accessed', () => {
- expect(history[0].url).to.equal(TEST_HISTORY_URLB);
- expect(history[1].url).to.equal(TEST_HISTORY_URLA);
- });
- });
-
- describe('setLoading', () => {
- beforeEach(() => {
- store.setLoading(true);
- });
-
- it('sets the loading state (true)', () => {
- expect(store.isLoading).to.be.true;
- });
-
- it('sets the loading state (false)', () => {
- store.setLoading(false);
-
- expect(store.isLoading).to.be.false;
- });
- });
-
- describe('setNextUrl', () => {
- it('sets the url', () => {
- store.setNextUrl(TEST_URL1);
-
- expect(store.nextUrl).to.equal(TEST_URL1);
- });
- });
-
- describe('setToken', () => {
- it('sets the token', () => {
- store.setToken(TEST_TOKEN);
-
- expect(store.token).to.equal(TEST_TOKEN);
- });
- });
- });
-
- describe('@computed', () => {
- describe('encodedUrl', () => {
- describe('encodedPath', () => {
- it('encodes current', () => {
- store.setCurrentUrl(TEST_URL1);
- expect(store.encodedPath).to.match(
- /http:\/\/home\.web3\.site:8545\/web\/DSTPRV1BD1T78W1T5WQQ6VVDCMQ78SBKEGQ68VVDC5MPWBK3DXPG\?t=[0-9]*$/
- );
- });
- });
-
- it('encodes current', () => {
- store.setCurrentUrl(TEST_URL1);
- expect(store.encodedUrl).to.match(
- /^http:\/\/DSTPRV1BD1T78W1T5WQQ6VVDCMQ78SBKEGQ68VVDC5MPWBK3DXPG\.web\.web3\.site:8545\?t=[0-9]*$/
- );
- });
- });
-
- describe('frameId', () => {
- it('creates an id', () => {
- expect(store.frameId).to.be.ok;
- });
- });
-
- describe('isPristine', () => {
- it('is true when current === next', () => {
- store.setCurrentUrl(TEST_URL1);
- store.setNextUrl(TEST_URL1);
-
- expect(store.isPristine).to.be.true;
- });
-
- it('is false when current !== next', () => {
- store.setCurrentUrl(TEST_URL1);
- store.setNextUrl(TEST_URL2);
-
- expect(store.isPristine).to.be.false;
- });
- });
- });
-
- describe('operations', () => {
- describe('generateToken', () => {
- beforeEach(() => {
- return store.generateToken();
- });
-
- it('calls signer_generateWebProxyAccessToken', () => {
- expect(api.signer.generateWebProxyAccessToken).to.have.been.calledOnce;
- });
-
- it('sets the token as retrieved', () => {
- expect(store.token).to.equal(TEST_TOKEN);
- });
- });
-
- describe('loadHistory', () => {
- beforeEach(() => {
- return store.loadHistory();
- });
-
- it('calls parity_listRecentDapps', () => {
- expect(api.parity.listRecentDapps).to.have.been.calledOnce;
- });
-
- it('sets the history as retrieved', () => {
- expect(store.history.peek().length).not.to.equal(0);
- });
- });
- });
-});
diff --git a/js/packages/dapp-web/web.css b/js/packages/dapp-web/web.css
deleted file mode 100644
index 3ea68bb6c..000000000
--- a/js/packages/dapp-web/web.css
+++ /dev/null
@@ -1,68 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-.wrapper {
- border: 0;
- position: absolute;
- height: 100%;
- width: 100%;
-}
-
-.loading {
- text-align: center;
- margin-top: 5em;
- color: #999;
- font-size: 2em;
-}
-
-$addressbar: 36px;
-.url {
- position: absolute;
- top: 0;
- width: 100%;
- box-sizing: border-box;
- height: $addressbar;
- line-height: $addressbar;
- display: flex;
- background: rgba(0, 0, 0, 0.85);
-
- > button {
- min-width: 50px !important;
- }
-
- > input {
- flex: 1;
- font-size: 1.1em;
- padding: 0.2em 0.5em;
- border-radius: 0.25em;
- border: none;
- background: #666;
- color: #eee;
- outline: none;
- box-shadow: 0 0 2px #111 inset;
- margin: 2px 0;
- }
-}
-
-.frame {
- position: absolute;
- width: 100%;
- height: calc(100% - $addressbar);
- top: $addressbar;
- bottom: 0;
- left: 0;
- right: 0;
-}
diff --git a/js/packages/dapp-web/web.js b/js/packages/dapp-web/web.js
deleted file mode 100644
index ec627b68b..000000000
--- a/js/packages/dapp-web/web.js
+++ /dev/null
@@ -1,94 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { observer } from 'mobx-react';
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
-import { FormattedMessage } from 'react-intl';
-
-import AddressBar from './AddressBar';
-import Store from './store';
-
-import styles from './web.css';
-
-@observer
-export default class Web extends Component {
- static contextTypes = {
- api: PropTypes.object.isRequired
- }
-
- static propTypes = {
- params: PropTypes.object.isRequired
- }
-
- store = Store.get(this.context.api);
-
- componentDidMount () {
- this.store.gotoUrl(this.props.params.url);
- }
-
- componentWillReceiveProps (props) {
- this.store.gotoUrl(props.params.url);
- }
-
- render () {
- const { currentUrl, token } = this.store;
-
- if (!token) {
- return (
-
- );
- }
-
- iframeOnLoad = () => {
- this.store.setLoading(false);
- };
-}
diff --git a/js/packages/dapp-web/web.spec.js b/js/packages/dapp-web/web.spec.js
deleted file mode 100644
index 8729cbf61..000000000
--- a/js/packages/dapp-web/web.spec.js
+++ /dev/null
@@ -1,55 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { shallow } from 'enzyme';
-import React from 'react';
-
-import { DEFAULT_URL } from './store';
-import Web from './web';
-
-let api;
-let component;
-
-function createApi () {
- api = {};
-
- return api;
-}
-
-function render (url = DEFAULT_URL) {
- component = shallow(
- ,
- {
- context: { api: createApi() }
- }
- );
-
- return component;
-}
-
-describe('views/Web', () => {
- beforeEach(() => {
- render();
- });
-
- it('renders defaults', () => {
- expect(component).to.be.ok;
- });
-
- it('renders loading with no token', () => {
- expect(component.find('FormattedMessage').props().id).to.equal('web.requestToken');
- });
-});
diff --git a/js/packages/dapps/README.md b/js/packages/dapps/README.md
deleted file mode 100644
index f29e29f3a..000000000
--- a/js/packages/dapps/README.md
+++ /dev/null
@@ -1 +0,0 @@
-# Parity builtin dapps
diff --git a/js/packages/dapps/index.ejs b/js/packages/dapps/index.ejs
deleted file mode 100644
index 8b65fbf19..000000000
--- a/js/packages/dapps/index.ejs
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
-
-
-
- <%= htmlWebpackPlugin.options.title %>
-
-
-
-
-
Loading
-
-
-
-
diff --git a/js/packages/dapps/package.json b/js/packages/dapps/package.json
deleted file mode 100644
index 65288c85c..000000000
--- a/js/packages/dapps/package.json
+++ /dev/null
@@ -1,33 +0,0 @@
-{
- "name": "@parity/dapps",
- "description": "Parity dapps",
- "version": "1.99.99",
- "main": "index.js",
- "author": "Parity Team ",
- "maintainers": [],
- "contributors": [],
- "license": "GPL-3.0",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/paritytech/dapps.git"
- },
- "keywords": [],
- "scripts": {},
- "devDependencies": {},
- "dependencies": {
- "@parity/dapp-account": "file:../dapp-account",
- "@parity/dapp-develop": "file:../dapp-develop",
- "base32.js": "0.1.0",
- "bytes": "2.4.0",
- "format-number": "2.0.1",
- "phoneformat.js": "1.0.3",
- "react-codemirror": "^0.3.0",
- "react-element-to-jsx-string": "6.0.0",
- "react-inspector": "paritytech/react-inspector",
- "react-markdown": "2.4.4",
- "material-ui": "0.16.5",
- "validator": "6.2.0",
- "rlp": "2.0.0"
- },
- "peerDependencies": {}
-}
diff --git a/js/packages/dapps/static/.gitkeep b/js/packages/dapps/static/.gitkeep
deleted file mode 100644
index e69de29bb..000000000
diff --git a/js/packages/dapps/style.css b/js/packages/dapps/style.css
deleted file mode 100644
index 352002bc5..000000000
--- a/js/packages/dapps/style.css
+++ /dev/null
@@ -1,48 +0,0 @@
-/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
-/* This file is part of Parity.
-/*
-/* Parity is free software: you can redistribute it and/or modify
-/* it under the terms of the GNU General Public License as published by
-/* the Free Software Foundation, either version 3 of the License, or
-/* (at your option) any later version.
-/*
-/* Parity is distributed in the hope that it will be useful,
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-/* GNU General Public License for more details.
-/*
-/* You should have received a copy of the GNU General Public License
-/* along with Parity. If not, see .
-*/
-
-:root,
-:root body {
- background: #fff;
- border: 0;
- color: #333;
- font-size: 16px;
- font-family: 'Roboto', 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', Geneva, Arial, sans-serif;
- font-weight: 300;
- margin: 0;
- padding: 0;
- vertical-align: top;
-}
-
-:root,
-:root body,
-:root :global(#container) {
- min-height: 100%;
- width: 100%;
- display: flex;
- flex: 1;
- flex-direction: column;
-}
-
-:root * {
- font-weight: 300;
-}
-
-:root :global(#container) > div {
- flex: 1;
- flex-direction: column;
-}
diff --git a/js/packages/ledger/index.js b/js/packages/ledger/index.js
deleted file mode 100644
index a5b876dca..000000000
--- a/js/packages/ledger/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default from './ledger';
diff --git a/js/packages/ledger/ledger.js b/js/packages/ledger/ledger.js
deleted file mode 100644
index 13a671998..000000000
--- a/js/packages/ledger/ledger.js
+++ /dev/null
@@ -1,136 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import 'u2f-api-polyfill';
-
-import BigNumber from 'bignumber.js';
-import Transaction from 'ethereumjs-tx';
-import u2fapi from 'u2f-api';
-
-import Ledger3 from './vendor/ledger3';
-import LedgerEth from './vendor/ledger-eth';
-
-const LEDGER_PATH_ETC = "44’/60’/160720'/0'/0";
-const LEDGER_PATH_ETH = "44'/60'/0'/0";
-const SCRAMBLE_KEY = 'w0w';
-
-function numberToHex (number) {
- return `0x${new BigNumber(number).toString(16)}`;
-}
-
-export default class Ledger {
- constructor (api, ledger) {
- this._api = api;
- this._ledger = ledger;
-
- this._isSupported = false;
-
- this.checkJSSupport();
- }
-
- // FIXME: Until we have https support from Parity u2f will not work. Here we mark it completely
- // as unsupported until a full end-to-end environment is available.
- get isSupported () {
- return false && this._isSupported;
- }
-
- checkJSSupport () {
- return u2fapi
- .isSupported()
- .then((isSupported) => {
- console.log('Ledger:checkJSSupport', isSupported);
-
- this._isSupported = isSupported;
- });
- }
-
- getAppConfiguration () {
- return new Promise((resolve, reject) => {
- this._ledger.getAppConfiguration((response, error) => {
- if (error) {
- reject(error);
- return;
- }
-
- resolve(response);
- });
- });
- }
-
- scan () {
- return new Promise((resolve, reject) => {
- this._ledger.getAddress(LEDGER_PATH_ETH, (response, error) => {
- if (error) {
- reject(error);
- return;
- }
-
- resolve([response.address]);
- }, true, false);
- });
- }
-
- signTransaction (transaction) {
- return this._api.net.version().then((_chainId) => {
- return new Promise((resolve, reject) => {
- const chainId = new BigNumber(_chainId).toNumber();
- const tx = new Transaction({
- data: transaction.data || transaction.input,
- gasPrice: numberToHex(transaction.gasPrice),
- gasLimit: numberToHex(transaction.gasLimit),
- nonce: numberToHex(transaction.nonce),
- to: transaction.to ? transaction.to.toLowerCase() : undefined,
- value: numberToHex(transaction.value),
- v: Buffer.from([chainId]), // pass the chainId to the ledger
- r: Buffer.from([]),
- s: Buffer.from([])
- });
- const rawTransaction = tx.serialize().toString('hex');
-
- this._ledger.signTransaction(LEDGER_PATH_ETH, rawTransaction, (response, error) => {
- if (error) {
- reject(error);
- return;
- }
-
- tx.v = Buffer.from(response.v, 'hex');
- tx.r = Buffer.from(response.r, 'hex');
- tx.s = Buffer.from(response.s, 'hex');
-
- if (chainId !== Math.floor((tx.v[0] - 35) / 2)) {
- reject(new Error('Invalid EIP155 signature received from Ledger.'));
- return;
- }
-
- resolve(`0x${tx.serialize().toString('hex')}`);
- });
- });
- });
- }
-
- static create (api, ledger) {
- if (!ledger) {
- ledger = new LedgerEth(new Ledger3(SCRAMBLE_KEY));
- }
-
- return new Ledger(api, ledger);
- }
-}
-
-export {
- LEDGER_PATH_ETC,
- LEDGER_PATH_ETH
-};
diff --git a/js/packages/ledger/ledger.spec.js b/js/packages/ledger/ledger.spec.js
deleted file mode 100644
index e8171d6ea..000000000
--- a/js/packages/ledger/ledger.spec.js
+++ /dev/null
@@ -1,120 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import sinon from 'sinon';
-
-import Ledger from './';
-
-const TEST_ADDRESS = '0x63Cf90D3f0410092FC0fca41846f596223979195';
-
-let api;
-let ledger;
-let vendor;
-
-function createApi () {
- api = {
- net: {
- version: sinon.stub().resolves('2')
- }
- };
-
- return api;
-}
-
-function createVendor (error = null) {
- vendor = {
- getAddress: (path, callback) => {
- callback({
- address: TEST_ADDRESS
- }, error);
- },
- getAppConfiguration: (callback) => {
- callback({}, error);
- },
- signTransaction: (path, rawTransaction, callback) => {
- callback({
- v: [39],
- r: [0],
- s: [0]
- }, error);
- }
- };
-
- return vendor;
-}
-
-function create (error) {
- ledger = new Ledger(createApi(), createVendor(error));
-
- return ledger;
-}
-
-describe.skip('packages/ledger', () => {
- beforeEach(() => {
- create();
-
- sinon.spy(vendor, 'getAddress');
- sinon.spy(vendor, 'getAppConfiguration');
- sinon.spy(vendor, 'signTransaction');
- });
-
- afterEach(() => {
- vendor.getAddress.restore();
- vendor.getAppConfiguration.restore();
- vendor.signTransaction.restore();
- });
-
- describe('getAppConfiguration', () => {
- beforeEach(() => {
- return ledger.getAppConfiguration();
- });
-
- it('calls into getAppConfiguration', () => {
- expect(vendor.getAppConfiguration).to.have.been.called;
- });
- });
-
- describe('scan', () => {
- beforeEach(() => {
- return ledger.scan();
- });
-
- it('calls into getAddress', () => {
- expect(vendor.getAddress).to.have.been.called;
- });
- });
-
- describe('signTransaction', () => {
- beforeEach(() => {
- return ledger.signTransaction({
- data: '0x0',
- gasPrice: 20000000,
- gasLimit: 1000000,
- nonce: 2,
- to: '0x63Cf90D3f0410092FC0fca41846f596223979195',
- value: 1
- });
- });
-
- it('retrieves chainId via API', () => {
- expect(api.net.version).to.have.been.called;
- });
-
- it('calls into signTransaction', () => {
- expect(vendor.signTransaction).to.have.been.called;
- });
- });
-});
diff --git a/js/packages/ledger/package.json b/js/packages/ledger/package.json
deleted file mode 100644
index 8c27b8307..000000000
--- a/js/packages/ledger/package.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "name": "@parity/ledger",
- "description": "JS interface for Ledger Nano hardware",
- "version": "1.99.99",
- "main": "library.js",
- "author": "Parity Team ",
- "maintainers": [
- "Jaco Greeff"
- ],
- "contributors": [],
- "license": "GPL-3.0",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/paritytech/js-ledger.git"
- },
- "keywords": [
- ],
- "scripts": {
- },
- "devDependencies": {
- },
- "dependencies": {
- }
-}
diff --git a/js/packages/ledger/vendor/README.md b/js/packages/ledger/vendor/README.md
deleted file mode 100644
index a44c3521b..000000000
--- a/js/packages/ledger/vendor/README.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# Description
-
-Vendor files (c) 2016 [Ledger](https://github.com/LedgerHQ) for [Ledger Nano-S](https://www.ledgerwallet.com/) integration
-
-# Origin
-
-Files originally created via [https://github.com/kvhnuke/etherwallet/pull/248/files](https://github.com/kvhnuke/etherwallet/pull/248/files)
-
-# License
-
-Files in this directory is licensed under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) by their original author
diff --git a/js/packages/ledger/vendor/ledger-eth.js b/js/packages/ledger/vendor/ledger-eth.js
deleted file mode 100644
index 80ff0d0a6..000000000
--- a/js/packages/ledger/vendor/ledger-eth.js
+++ /dev/null
@@ -1,166 +0,0 @@
-/********************************************************************************
-* Ledger Communication toolkit
-* (c) 2016 Ledger
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-********************************************************************************/
-
-/* eslint-disable */
-
-'use strict';
-
-var LedgerEth = function(comm) {
- this.comm = comm;
-}
-
-LedgerEth.splitPath = function(path) {
- var result = [];
- var components = path.split('/');
- components.forEach(function (element, index) {
- var number = parseInt(element, 10);
- if (isNaN(number)) {
- return;
- }
- if ((element.length > 1) && (element[element.length - 1] == "'")) {
- number += 0x80000000;
- }
- result.push(number);
- });
- return result;
-}
-
-// callback is function(response, error)
-LedgerEth.prototype.getAddress = function(path, callback, boolDisplay, boolChaincode) {
- var splitPath = LedgerEth.splitPath(path);
- var buffer = new Buffer(5 + 1 + splitPath.length * 4);
- buffer[0] = 0xe0;
- buffer[1] = 0x02;
- buffer[2] = (boolDisplay ? 0x01 : 0x00);
- buffer[3] = (boolChaincode ? 0x01 : 0x00);
- buffer[4] = 1 + splitPath.length * 4;
- buffer[5] = splitPath.length;
- splitPath.forEach(function (element, index) {
- buffer.writeUInt32BE(element, 6 + 4 * index);
- });
- var self = this;
- var localCallback = function(response, error) {
- if (typeof error != "undefined") {
- callback(undefined, error);
- }
- else {
- var result = {};
- response = new Buffer(response, 'hex');
- var sw = response.readUInt16BE(response.length - 2);
- if (sw != 0x9000) {
- callback(undefined, "Invalid status " + sw.toString(16));
- return;
- }
- var publicKeyLength = response[0];
- var addressLength = response[1 + publicKeyLength];
- result['publicKey'] = response.slice(1, 1 + publicKeyLength).toString('hex');
- result['address'] = "0x" + response.slice(1 + publicKeyLength + 1, 1 + publicKeyLength + 1 + addressLength).toString('ascii');
- if (boolChaincode) {
- result['chainCode'] = response.slice(1 + publicKeyLength + 1 + addressLength, 1 + publicKeyLength + 1 + addressLength + 32).toString('hex');
- }
- callback(result);
- }
- };
- this.comm.exchange(buffer.toString('hex'), localCallback);
-}
-
-// callback is function(response, error)
-LedgerEth.prototype.signTransaction = function(path, rawTxHex, callback) {
- var splitPath = LedgerEth.splitPath(path);
- var offset = 0;
- var rawTx = new Buffer(rawTxHex, 'hex');
- var apdus = [];
- while (offset != rawTx.length) {
- var maxChunkSize = (offset == 0 ? (150 - 1 - splitPath.length * 4) : 150)
- var chunkSize = (offset + maxChunkSize > rawTx.length ? rawTx.length - offset : maxChunkSize);
- var buffer = new Buffer(offset == 0 ? 5 + 1 + splitPath.length * 4 + chunkSize : 5 + chunkSize);
- buffer[0] = 0xe0;
- buffer[1] = 0x04;
- buffer[2] = (offset == 0 ? 0x00 : 0x80);
- buffer[3] = 0x00;
- buffer[4] = (offset == 0 ? 1 + splitPath.length * 4 + chunkSize : chunkSize);
- if (offset == 0) {
- buffer[5] = splitPath.length;
- splitPath.forEach(function (element, index) {
- buffer.writeUInt32BE(element, 6 + 4 * index);
- });
- rawTx.copy(buffer, 6 + 4 * splitPath.length, offset, offset + chunkSize);
- }
- else {
- rawTx.copy(buffer, 5, offset, offset + chunkSize);
- }
- apdus.push(buffer.toString('hex'));
- offset += chunkSize;
- }
- var self = this;
- var localCallback = function(response, error) {
- if (typeof error != "undefined") {
- callback(undefined, error);
- }
- else {
- response = new Buffer(response, 'hex');
- var sw = response.readUInt16BE(response.length - 2);
- if (sw != 0x9000) {
- callback(undefined, "Invalid status " + sw.toString(16));
- return;
- }
- if (apdus.length == 0) {
- var result = {};
- result['v'] = response.slice(0, 1).toString('hex');
- result['r'] = response.slice(1, 1 + 32).toString('hex');
- result['s'] = response.slice(1 + 32, 1 + 32 + 32).toString('hex');
- callback(result);
- }
- else {
- self.comm.exchange(apdus.shift(), localCallback);
- }
- }
- };
- self.comm.exchange(apdus.shift(), localCallback);
-}
-
-// callback is function(response, error)
-LedgerEth.prototype.getAppConfiguration = function(callback) {
- var buffer = new Buffer(5);
- buffer[0] = 0xe0;
- buffer[1] = 0x06;
- buffer[2] = 0x00;
- buffer[3] = 0x00;
- buffer[4] = 0x00;
- var localCallback = function(response, error) {
- if (typeof error != "undefined") {
- callback(undefined, error);
- }
- else {
- response = new Buffer(response, 'hex');
- var result = {};
- var sw = response.readUInt16BE(response.length - 2);
- if (sw != 0x9000) {
- callback(undefined, "Invalid status " + sw.toString(16));
- return;
- }
- result['arbitraryDataEnabled'] = (response[0] & 0x01);
- result['version'] = "" + response[1] + '.' + response[2] + '.' + response[3];
- callback(result);
- }
- };
- this.comm.exchange(buffer.toString('hex'), localCallback);
-}
-
-module.exports = LedgerEth;
-
-/* eslint-enable */
diff --git a/js/packages/ledger/vendor/ledger3.js b/js/packages/ledger/vendor/ledger3.js
deleted file mode 100644
index 9601279ad..000000000
--- a/js/packages/ledger/vendor/ledger3.js
+++ /dev/null
@@ -1,72 +0,0 @@
-/********************************************************************************
-* Ledger Communication toolkit
-* (c) 2016 Ledger
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-********************************************************************************/
-
-/* eslint-disable */
-
-'use strict';
-
-var Ledger3 = function(scrambleKey, timeoutSeconds) {
- this.scrambleKey = new Buffer(scrambleKey, 'ascii');
- this.timeoutSeconds = timeoutSeconds;
-}
-
-Ledger3.wrapApdu = function(apdu, key) {
- var result = new Buffer(apdu.length);
- for (var i=0; i.
-
-const nock = require('nock');
-
-const APIKEY = '0x123454321';
-
-function mockget (shapeshift, requests) {
- let scope = nock(shapeshift.getRpc().ENDPOINT);
-
- requests.forEach((request) => {
- scope = scope
- .get(`/${request.path}`)
- .reply(request.code || 200, () => {
- return request.reply;
- });
- });
-
- return scope;
-}
-
-function mockpost (shapeshift, requests) {
- let scope = nock(shapeshift.getRpc().ENDPOINT);
-
- requests.forEach((request) => {
- scope = scope
- .post(`/${request.path}`)
- .reply(request.code || 200, (uri, body) => {
- scope.body = scope.body || {};
- scope.body[request.path] = body;
-
- return request.reply;
- });
- });
-
- return scope;
-}
-
-module.exports = {
- APIKEY,
- mockget,
- mockpost
-};
diff --git a/js/packages/shapeshift/index.js b/js/packages/shapeshift/index.js
deleted file mode 100644
index de0df1041..000000000
--- a/js/packages/shapeshift/index.js
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import initRpc from './rpc';
-import _initShapeshift from './shapeshift';
-
-export default function initShapeshift (apikey) {
- return _initShapeshift(initRpc(apikey));
-}
diff --git a/js/packages/shapeshift/library.js b/js/packages/shapeshift/library.js
deleted file mode 100644
index 466b44815..000000000
--- a/js/packages/shapeshift/library.js
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import es6Promise from 'es6-promise';
-es6Promise.polyfill();
-
-const isNode = typeof global !== 'undefined' && typeof global !== 'undefined';
-const isBrowser = typeof self !== 'undefined' && typeof self.window !== 'undefined';
-
-if (isBrowser) {
- require('whatwg-fetch');
-}
-
-if (isNode) {
- global.fetch = require('node-fetch');
-}
-
-import ShapeShift from './index';
-
-export default ShapeShift;
diff --git a/js/packages/shapeshift/package.json b/js/packages/shapeshift/package.json
deleted file mode 100644
index b2abf2d52..000000000
--- a/js/packages/shapeshift/package.json
+++ /dev/null
@@ -1,31 +0,0 @@
-{
- "name": "@parity/shapeshift",
- "description": "The Parity Promise-based library for interfacing with ShapeShift over HTTP",
- "version": "1.99.99",
- "main": "library.js",
- "author": "Parity Team ",
- "maintainers": [
- "Jaco Greeff"
- ],
- "contributors": [],
- "license": "GPL-3.0",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/paritytech/js-shapeshift.git"
- },
- "keywords": [
- "Ethereum",
- "ABI",
- "API",
- "RPC",
- "Parity",
- "Promise"
- ],
- "scripts": {
- },
- "devDependencies": {
- },
- "dependencies": {
- "node-fetch": "~1.6.3"
- }
-}
diff --git a/js/packages/shapeshift/rpc.js b/js/packages/shapeshift/rpc.js
deleted file mode 100644
index 711a41c51..000000000
--- a/js/packages/shapeshift/rpc.js
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-const ENDPOINT = 'https://cors.shapeshift.io';
-
-function call (method, options) {
- return fetch(`${ENDPOINT}/${method}`, options)
- .then((response) => {
- if (!response.ok) {
- throw new Error(response.statusText);
- }
-
- return response.json();
- })
- .then((result) => {
- if (result.error) {
- throw new Error(result.error);
- }
-
- return result;
- });
-}
-
-export default function (apiKey) {
- function get (method) {
- return call(method, {
- method: 'GET',
- headers: {
- 'Accept': 'application/json'
- }
- });
- }
-
- function post (method, data) {
- const params = Object.assign({}, { apiKey }, data);
- const body = JSON.stringify(params);
-
- return call(method, {
- method: 'POST',
- headers: {
- 'Accept': 'application/json',
- 'Content-Type': 'application/json',
- 'Content-Length': body.length
- },
- body
- });
- }
-
- return {
- ENDPOINT,
- get,
- post
- };
-}
diff --git a/js/packages/shapeshift/rpc.spec.js b/js/packages/shapeshift/rpc.spec.js
deleted file mode 100644
index 78ede60cc..000000000
--- a/js/packages/shapeshift/rpc.spec.js
+++ /dev/null
@@ -1,91 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-const helpers = require('./helpers.spec.js');
-
-const ShapeShift = require('./index');
-const initShapeshift = (ShapeShift.default || ShapeShift);
-
-const mockget = helpers.mockget;
-const mockpost = helpers.mockpost;
-
-describe.skip('shapeshift/rpc', () => {
- let rpc;
- let shapeshift;
-
- beforeEach(() => {
- shapeshift = initShapeshift(helpers.APIKEY);
- rpc = shapeshift.getRpc();
- });
-
- describe('GET', () => {
- const REPLY = { test: 'this is some result' };
-
- let scope;
- let result;
-
- beforeEach(() => {
- scope = mockget(shapeshift, [{ path: 'test', reply: REPLY }]);
-
- return rpc
- .get('test')
- .then((_result) => {
- result = _result;
- });
- });
-
- it('does GET', () => {
- expect(scope.isDone()).to.be.true;
- });
-
- it('retrieves the info', () => {
- expect(result).to.deep.equal(REPLY);
- });
- });
-
- describe('POST', () => {
- const REPLY = { test: 'this is some result' };
-
- let scope;
- let result;
-
- beforeEach(() => {
- scope = mockpost(shapeshift, [{ path: 'test', reply: REPLY }]);
-
- return rpc
- .post('test', { input: 'stuff' })
- .then((_result) => {
- result = _result;
- });
- });
-
- it('does POST', () => {
- expect(scope.isDone()).to.be.true;
- });
-
- it('retrieves the info', () => {
- expect(result).to.deep.equal(REPLY);
- });
-
- it('passes the input object', () => {
- expect(scope.body.test.input).to.equal('stuff');
- });
-
- it('passes the apikey specified', () => {
- expect(scope.body.test.apiKey).to.equal(helpers.APIKEY);
- });
- });
-});
diff --git a/js/packages/shapeshift/shapeshift.js b/js/packages/shapeshift/shapeshift.js
deleted file mode 100644
index 5ecf141da..000000000
--- a/js/packages/shapeshift/shapeshift.js
+++ /dev/null
@@ -1,135 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-export default function (rpc) {
- let _subscriptions = [];
- let _pollStatusIntervalId = null;
- let _subscriptionPromises = null;
-
- function getCoins () {
- return rpc.get('getcoins');
- }
-
- function getMarketInfo (pair) {
- return rpc.get(`marketinfo/${pair}`);
- }
-
- function getRpc () {
- return rpc;
- }
-
- function getStatus (depositAddress) {
- return rpc.get(`txStat/${depositAddress}`);
- }
-
- function shift (toAddress, returnAddress, pair) {
- return rpc.post('shift', {
- pair,
- returnAddress,
- withdrawal: toAddress
- });
- }
-
- function subscribe (depositAddress, callback) {
- if (!depositAddress || !callback) {
- return;
- }
-
- const index = _subscriptions.length;
-
- _subscriptions.push({
- callback,
- depositAddress,
- index
- });
-
- if (_pollStatusIntervalId === null) {
- _pollStatusIntervalId = setInterval(_pollStatus, 2000);
- }
- }
-
- function unsubscribe (depositAddress) {
- _subscriptions = _subscriptions.filter((sub) => sub.depositAddress !== depositAddress);
-
- if (_subscriptions.length === 0) {
- clearInterval(_pollStatusIntervalId);
- _pollStatusIntervalId = null;
- }
-
- return true;
- }
-
- function _getSubscriptionStatus (subscription) {
- if (!subscription) {
- return Promise.resolve();
- }
-
- return getStatus(subscription.depositAddress)
- .then((result) => {
- switch (result.status) {
- case 'no_deposits':
- case 'received':
- subscription.callback(null, result);
- return true;
-
- case 'complete':
- subscription.callback(null, result);
- unsubscribe(subscription.depositAddress);
- return true;
-
- case 'failed':
- subscription.callback({
- message: status.error,
- fatal: true
- });
- unsubscribe(subscription.depositAddress);
- return true;
- }
- })
- .catch(() => {
- return true;
- });
- }
-
- function _pollStatus () {
- _subscriptionPromises = Promise.all(_subscriptions.map(_getSubscriptionStatus));
- }
-
- function _getSubscriptions () {
- return _subscriptions;
- }
-
- function _getSubscriptionPromises () {
- return _subscriptionPromises;
- }
-
- function _isPolling () {
- return _pollStatusIntervalId !== null;
- }
-
- return {
- _getSubscriptions,
- _getSubscriptionPromises,
- _isPolling,
- getCoins,
- getMarketInfo,
- getRpc,
- getStatus,
- shift,
- subscribe,
- unsubscribe
- };
-}
diff --git a/js/packages/shapeshift/shapeshift.spec.js b/js/packages/shapeshift/shapeshift.spec.js
deleted file mode 100644
index 7a92979fc..000000000
--- a/js/packages/shapeshift/shapeshift.spec.js
+++ /dev/null
@@ -1,220 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-const sinon = require('sinon');
-
-const ShapeShift = require('./index');
-const initShapeshift = (ShapeShift.default || ShapeShift);
-
-const helpers = require('./helpers.spec.js');
-
-const mockget = helpers.mockget;
-const mockpost = helpers.mockpost;
-
-describe.skip('shapeshift/calls', () => {
- let clock;
- let shapeshift;
-
- beforeEach(() => {
- clock = sinon.useFakeTimers();
- shapeshift = initShapeshift(helpers.APIKEY);
- });
-
- afterEach(() => {
- clock.restore();
- });
-
- describe('getCoins', () => {
- const REPLY = {
- BTC: {
- name: 'Bitcoin',
- symbol: 'BTC',
- image: 'https://shapeshift.io/images/coins/bitcoin.png',
- status: 'available'
- },
- ETH: {
- name: 'Ether',
- symbol: 'ETH',
- image: 'https://shapeshift.io/images/coins/ether.png',
- status: 'available'
- }
- };
-
- let scope;
-
- beforeEach(() => {
- scope = mockget(shapeshift, [{ path: 'getcoins', reply: REPLY }]);
-
- return shapeshift.getCoins();
- });
-
- it('makes the call', () => {
- expect(scope.isDone()).to.be.ok;
- });
- });
-
- describe('getMarketInfo', () => {
- const REPLY = {
- pair: 'btc_ltc',
- rate: 128.17959917,
- minerFee: 0.003,
- limit: 0,
- minimum: 0.00004632
- };
-
- let scope;
-
- beforeEach(() => {
- scope = mockget(shapeshift, [{ path: 'marketinfo/btc_ltc', reply: REPLY }]);
-
- return shapeshift.getMarketInfo('btc_ltc');
- });
-
- it('makes the call', () => {
- expect(scope.isDone()).to.be.ok;
- });
- });
-
- describe('getStatus', () => {
- const REPLY = {
- status: '0x123',
- address: '0x123'
- };
-
- let scope;
-
- beforeEach(() => {
- scope = mockget(shapeshift, [{ path: 'txStat/0x123', reply: REPLY }]);
-
- return shapeshift.getStatus('0x123');
- });
-
- it('makes the call', () => {
- expect(scope.isDone()).to.be.ok;
- });
- });
-
- describe('shift', () => {
- const REPLY = {
- deposit: '1BTC',
- depositType: 'btc',
- withdrawal: '0x456',
- withdrawalType: 'eth'
- };
-
- let scope;
-
- beforeEach(() => {
- scope = mockpost(shapeshift, [{ path: 'shift', reply: REPLY }]);
-
- return shapeshift.shift('0x456', '1BTC', 'btc_eth');
- });
-
- it('makes the call', () => {
- expect(scope.isDone()).to.be.ok;
- });
-
- describe('body', () => {
- it('has withdrawal set', () => {
- expect(scope.body.shift.withdrawal).to.equal('0x456');
- });
-
- it('has returnAddress set', () => {
- expect(scope.body.shift.returnAddress).to.equal('1BTC');
- });
-
- it('has pair set', () => {
- expect(scope.body.shift.pair).to.equal('btc_eth');
- });
- });
- });
-
- describe('subscriptions', () => {
- const ADDRESS = '0123456789abcdef';
- const REPLY = {
- status: 'complete',
- address: ADDRESS
- };
-
- let callback;
-
- beforeEach(() => {
- mockget(shapeshift, [{ path: `txStat/${ADDRESS}`, reply: REPLY }]);
- callback = sinon.stub();
- shapeshift.subscribe(ADDRESS, callback);
- });
-
- describe('subscribe', () => {
- it('adds the depositAddress to the list', () => {
- const subscriptions = shapeshift._getSubscriptions();
-
- expect(subscriptions.length).to.equal(1);
- expect(subscriptions[0].depositAddress).to.equal(ADDRESS);
- });
-
- it('starts the polling timer', () => {
- expect(shapeshift._isPolling()).to.be.true;
- });
-
- it('calls the callback once the timer has elapsed', () => {
- clock.tick(2222);
-
- return shapeshift._getSubscriptionPromises().then(() => {
- expect(callback).to.have.been.calledWith(null, REPLY);
- });
- });
-
- it('auto-unsubscribes on completed', () => {
- clock.tick(2222);
-
- return shapeshift._getSubscriptionPromises().then(() => {
- expect(shapeshift._getSubscriptions().length).to.equal(0);
- });
- });
- });
-
- describe('unsubscribe', () => {
- it('unbsubscribes when requested', () => {
- expect(shapeshift._getSubscriptions().length).to.equal(1);
- shapeshift.unsubscribe(ADDRESS);
- expect(shapeshift._getSubscriptions().length).to.equal(0);
- });
-
- it('clears the polling on no subscriptions', () => {
- shapeshift.unsubscribe(ADDRESS);
- expect(shapeshift._isPolling()).to.be.false;
- });
-
- it('handles unsubscribe of auto-unsubscribe', () => {
- clock.tick(2222);
-
- return shapeshift._getSubscriptionPromises().then(() => {
- expect(shapeshift.unsubscribe(ADDRESS)).to.be.true;
- });
- });
-
- it('handles unsubscribe when multiples listed', () => {
- const ADDRESS2 = 'abcdef0123456789';
-
- shapeshift.subscribe(ADDRESS2, sinon.stub());
- expect(shapeshift._getSubscriptions().length).to.equal(2);
- expect(shapeshift._getSubscriptions()[0].depositAddress).to.equal(ADDRESS);
- shapeshift.unsubscribe(ADDRESS);
- expect(shapeshift._getSubscriptions()[0].depositAddress).to.equal(ADDRESS2);
- });
- });
- });
-});
diff --git a/js/src/Requests/savedRequests.js b/js/src/Requests/savedRequests.js
deleted file mode 100644
index 546324a56..000000000
--- a/js/src/Requests/savedRequests.js
+++ /dev/null
@@ -1,107 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import store from 'store';
-
-export const LS_REQUESTS_KEY = '_parity::requests';
-
-export default class SavedRequests {
- load (api) {
- return this.loadRequests(api)
- .catch((error) => {
- console.error(error);
- return [];
- });
- }
-
- /**
- * Load the requests of the current network
- */
- loadRequests (api) {
- const requests = this._get();
-
- return api.parity.localTransactions()
- .then((localTransactions) => {
- const promises = Object.values(requests).map((request) => {
- const { requestId, transactionHash } = request;
-
- if (transactionHash) {
- // The transaction might be from an other
- // chain
- if (!localTransactions[transactionHash]) {
- this.remove(requestId);
- return null;
- }
-
- return request;
- }
-
- // The request hasn't been signed yet
- return this._requestExists(api, requestId)
- .then((exists) => {
- if (!exists) {
- this.remove(requestId);
- return null;
- }
-
- return request;
- });
- });
-
- return Promise.all(promises);
- })
- .then((requests) => requests.filter((request) => request));
- }
-
- save (requestId, requestData) {
- const requests = this._get();
-
- requests[requestId] = {
- ...(requests[requestId] || {}),
- ...requestData
- };
-
- this._set(requests);
- }
-
- remove (requestId) {
- const requests = this._get();
-
- delete requests[requestId];
- this._set(requests);
- }
-
- _get () {
- return store.get(LS_REQUESTS_KEY) || {};
- }
-
- _set (requests = {}) {
- if (Object.keys(requests).length > 0) {
- return store.set(LS_REQUESTS_KEY, requests);
- }
-
- return store.remove(LS_REQUESTS_KEY);
- }
-
- _requestExists (api, requestId) {
- return api.parity
- .checkRequest(requestId)
- .then(() => true)
- .catch(() => {
- return false;
- });
- }
-}
diff --git a/js/src/Requests/savedRequests.spec.js b/js/src/Requests/savedRequests.spec.js
deleted file mode 100644
index ef10e0210..000000000
--- a/js/src/Requests/savedRequests.spec.js
+++ /dev/null
@@ -1,99 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import sinon from 'sinon';
-import store from 'store';
-
-import SavedRequests, { LS_REQUESTS_KEY } from './savedRequests';
-
-const DEFAULT_REQUEST = {
- requestId: '0x1',
- transaction: {}
-};
-
-const SIGNED_REQUEST = {
- requestId: '0x2',
- transactionHash: '0xabcdef',
- transaction: {}
-};
-
-const api = createApi();
-const savedRequests = new SavedRequests();
-
-function createApi () {
- return {
- parity: {
- checkRequest: sinon.stub().resolves(),
- localTransactions: sinon.stub().resolves([])
- }
- };
-}
-
-describe('Requests/savedRequests', () => {
- beforeEach((done) => {
- store.set(LS_REQUESTS_KEY, {
- [DEFAULT_REQUEST.requestId]: DEFAULT_REQUEST,
- [SIGNED_REQUEST.requestId]: SIGNED_REQUEST
- });
-
- savedRequests.load(api)
- .then(() => done());
- });
-
- afterEach(() => {
- store.set(LS_REQUESTS_KEY, {});
- });
-
- it('gets requests from local storage', () => {
- const requests = savedRequests._get();
-
- expect(requests[DEFAULT_REQUEST.requestId]).to.deep.equal(DEFAULT_REQUEST);
- });
-
- it('sets requests to local storage', () => {
- savedRequests._set({});
-
- const requests = savedRequests._get();
-
- expect(requests).to.deep.equal({});
- });
-
- it('removes requests', () => {
- savedRequests.remove(DEFAULT_REQUEST.requestId);
-
- const requests = savedRequests._get();
-
- expect(requests[DEFAULT_REQUEST.requestId]).to.be.undefined;
- });
-
- it('saves new requests', () => {
- savedRequests.save(DEFAULT_REQUEST.requestId, { extraData: true });
-
- const requests = savedRequests._get();
-
- expect(requests[DEFAULT_REQUEST.requestId]).to.deep.equal({
- ...DEFAULT_REQUEST,
- extraData: true
- });
- });
-
- it('loads requests', () => {
- return savedRequests.load(api)
- .then((requests) => {
- expect(requests).to.deep.equal([ DEFAULT_REQUEST ]);
- });
- });
-});
diff --git a/js/src/Signer/components/TransactionPendingFormConfirm/transactionPendingFormConfirm.js b/js/src/Signer/components/TransactionPendingFormConfirm/transactionPendingFormConfirm.js
index cbf155546..633452347 100644
--- a/js/src/Signer/components/TransactionPendingFormConfirm/transactionPendingFormConfirm.js
+++ b/js/src/Signer/components/TransactionPendingFormConfirm/transactionPendingFormConfirm.js
@@ -21,10 +21,9 @@ import ReactDOM from 'react-dom';
import { FormattedMessage } from 'react-intl';
import ReactTooltip from 'react-tooltip';
+import { generateTxQr, generateDecryptQr, generateDataQr } from '@parity/shared/util/qrscan';
import { Button, Form, Input, IdentityIcon, QrCode, QrScan } from '@parity/ui';
-import { generateTxQr, generateDecryptQr, generateDataQr } from '../../../Signer/utils/qrscan';
-
import styles from './transactionPendingFormConfirm.css';
const QR_VISIBLE = 1;
diff --git a/js/src/Signer/utils/qrscan.js b/js/src/Signer/utils/qrscan.js
deleted file mode 100644
index 6f6b0a82b..000000000
--- a/js/src/Signer/utils/qrscan.js
+++ /dev/null
@@ -1,141 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import Transaction from 'ethereumjs-tx';
-
-import { inAddress, inHex, inNumber10 } from '@parity/api/format/input';
-import { sha3 } from '@parity/api/util/sha3';
-
-export function createUnsignedTx (api, netVersion, transaction) {
- const { data, from, gas, gasPrice, to, value } = transaction;
-
- return api.parity
- .nextNonce(from)
- .then((_nonce) => {
- const chainId = parseInt(netVersion, 10);
- const nonce = (!transaction.nonce || transaction.nonce.isZero())
- ? _nonce
- : transaction.nonce;
-
- const tx = new Transaction({
- chainId,
- data: inHex(data),
- gasPrice: inHex(gasPrice),
- gasLimit: inHex(gas),
- nonce: inHex(nonce),
- to: to ? inHex(to) : undefined,
- value: inHex(value),
- r: 0,
- s: 0,
- v: chainId
- });
-
- const rlp = inHex(tx.serialize().toString('hex'));
- const hash = sha3(rlp);
-
- return {
- chainId,
- hash,
- nonce,
- rlp,
- tx
- };
- });
-}
-
-export function createSignedTx (netVersion, signature, unsignedTx) {
- const chainId = parseInt(netVersion, 10);
- const { data, gasPrice, gasLimit, nonce, to, value } = unsignedTx;
-
- const r = Buffer.from(signature.substr(2, 64), 'hex');
- const s = Buffer.from(signature.substr(66, 64), 'hex');
- const v = Buffer.from([parseInt(signature.substr(130, 2), 16) + (chainId * 2) + 35]);
-
- const tx = new Transaction({
- chainId,
- data,
- gasPrice,
- gasLimit,
- nonce,
- to,
- value,
- r,
- s,
- v
- });
-
- return {
- chainId,
- rlp: inHex(tx.serialize().toString('hex')),
- tx
- };
-}
-
-export function generateQr (from, tx, hash, rlp) {
- if (tx.data && tx.data.length > 64) {
- return JSON.stringify({
- action: 'signTransactionHash',
- data: {
- account: from.substr(2),
- hash: hash.substr(2),
- details: {
- gasPrice: inNumber10(inHex(tx.gasPrice.toString('hex') || '0')),
- gas: inNumber10(inHex(tx.gasLimit.toString('hex') || '0')),
- nonce: inNumber10(inHex(tx.nonce.toString('hex') || '0')),
- to: inAddress(tx.to.toString('hex')),
- value: inHex(tx.value.toString('hex') || '0')
- }
- }
- });
- }
-
- return JSON.stringify({
- action: 'signTransaction',
- data: {
- account: from.substr(2),
- rlp: rlp.substr(2)
- }
- });
-}
-
-export function generateDataQr (data) {
- return Promise.resolve({
- data,
- value: JSON.stringify({
- action: 'signData',
- data
- })
- });
-}
-
-export function generateDecryptQr (data) {
- return Promise.resolve({
- decrypt: data,
- value: JSON.stringify({
- action: 'decrypt',
- data
- })
- });
-}
-
-export function generateTxQr (api, netVersion, transaction) {
- return createUnsignedTx(api, netVersion, transaction)
- .then((qr) => {
- qr.value = generateQr(transaction.from, qr.tx, qr.hash, qr.rlp);
-
- return qr;
- });
-}
diff --git a/js/src/UpgradeParity/store.js b/js/src/UpgradeParity/store.js
deleted file mode 100644
index 6d97488df..000000000
--- a/js/src/UpgradeParity/store.js
+++ /dev/null
@@ -1,159 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import { action, computed, observable, transaction, toJS } from 'mobx';
-import store from 'store';
-
-const LS_UPDATE = '_parity::update';
-
-const A_MINUTE = 60 * 1000;
-const A_DAY = 24 * 60 * A_MINUTE;
-
-const STEP_INFO = 0;
-const STEP_UPDATING = 1;
-const STEP_COMPLETED = 2;
-const STEP_ERROR = 2;
-
-let instance = null;
-
-export default class Store {
- @observable available = null;
- @observable consensusCapability = null;
- @observable closed = true;
- @observable error = null;
- @observable remindAt = 0;
- @observable step = 0;
- @observable upgrading = null;
- @observable version = null;
-
- constructor (api) {
- this._api = api;
-
- this.loadStorage();
- this.checkUpgrade();
- }
-
- @computed get isVisible () {
- return !this.closed && Date.now() >= this.remindAt;
- }
-
- @action closeModal = () => {
- transaction(() => {
- this.closed = true;
- this.setStep(0, null);
- });
- }
-
- @action loadStorage = () => {
- const values = store.get(LS_UPDATE) || {};
-
- this.remindAt = values.remindAt ? values.remindAt : 0;
-
- return values;
- }
-
- @action openModal = () => {
- this.closed = false;
- }
-
- @action setStep = (step, error = null) => {
- transaction(() => {
- this.error = error;
- this.step = step;
- });
- }
-
- @action setUpgrading () {
- transaction(() => {
- this.upgrading = this.available;
- this.setStep(STEP_UPDATING, null);
- });
- }
-
- @action setVersions (available, version, consensusCapability) {
- transaction(() => {
- this.available = available;
- this.consensusCapability = consensusCapability;
- this.version = version;
- });
- }
-
- @action snoozeTillTomorrow = () => {
- this.remindAt = Date.now() + A_DAY;
- store.set(LS_UPDATE, Object.assign(this.loadStorage(), { remindAt: this.remindAt }));
- }
-
- @action upgradeNow = () => {
- this.setUpgrading();
-
- return this._api.parity
- .executeUpgrade()
- .then((result) => {
- if (!result) {
- throw new Error('Unable to complete update');
- }
-
- this.setStep(STEP_COMPLETED, null);
- })
- .catch((error) => {
- console.error('upgradeNow', error);
-
- this.setStep(STEP_ERROR, error);
- });
- }
-
- checkUpgrade = () => {
- if (!this._api) {
- return Promise.resolve(false);
- }
-
- return Promise
- .all([
- this._api.parity.upgradeReady(),
- this._api.parity.consensusCapability(),
- this._api.parity.versionInfo()
- ])
- .then(([available, consensusCapability, version]) => {
- if (!this.version || version.hash !== this.version.hash) {
- console.log('[checkUpgrade]', 'available:', available, 'version:', toJS(version.version), 'consensusCapability:', consensusCapability);
- }
-
- this.setVersions(available, version, consensusCapability);
-
- return true;
- })
- .catch((error) => {
- console.warn('checkUpgrade', error);
-
- return false;
- });
- }
-
- static get (api) {
- if (!instance) {
- instance = new Store(api);
- }
-
- return instance;
- }
-}
-
-export {
- STEP_COMPLETED,
- STEP_ERROR,
- STEP_INFO,
- STEP_UPDATING
-};
diff --git a/js/src/UpgradeParity/store.spec.js b/js/src/UpgradeParity/store.spec.js
deleted file mode 100644
index c638eb9cb..000000000
--- a/js/src/UpgradeParity/store.spec.js
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright 2015-2017 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import Store from './store';
-
-let store;
-
-describe('UpgradeParity/store', () => {
- describe('@actions', () => {
- beforeEach(() => {
- store = new Store();
- });
-
- describe('openModal & closeModal', () => {
- it('toggles between the closed states', () => {
- expect(store.closed).to.be.true;
- store.openModal();
- expect(store.closed).to.be.false;
- store.closeModal();
- expect(store.closed).to.be.true;
- });
-
- it('resets the step state upon closing', () => {
- store.setStep(5, 'soem error');
- store.closeModal();
- expect(store.step).to.equal(0);
- expect(store.error).to.be.null;
- });
- });
-
- describe('setStep', () => {
- it('sets the step as provided', () => {
- expect(store.step).to.equal(0);
- store.setStep(3);
- expect(store.step).to.equal(3);
- });
-
- it('sets the error when provided', () => {
- expect(store.error).to.be.null;
- store.setStep(3, new Error('some error'));
- expect(store.error).to.match(/some error/);
- });
- });
- });
-});
diff --git a/js/src/UpgradeParity/upgradeParity.js b/js/src/UpgradeParity/upgradeParity.js
index bde0bbcda..afc2fe5b8 100644
--- a/js/src/UpgradeParity/upgradeParity.js
+++ b/js/src/UpgradeParity/upgradeParity.js
@@ -19,10 +19,10 @@ import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { FormattedMessage } from 'react-intl';
+import { STEP_COMPLETED, STEP_ERROR, STEP_INFO, STEP_UPDATING } from '@parity/shared/mobx/upgradeParity';
import { Button, Portal } from '@parity/ui';
import { CancelIcon, DoneIcon, ErrorIcon, NextIcon, UpdateIcon, UpdateWaitIcon } from '@parity/ui/Icons';
-import { STEP_COMPLETED, STEP_ERROR, STEP_INFO, STEP_UPDATING } from './store';
import styles from './upgradeParity.css';
@observer