diff --git a/js/.npmrc b/js/.npmrc
index a00908d4f..5dce03c65 100644
--- a/js/.npmrc
+++ b/js/.npmrc
@@ -1 +1,2 @@
save-prefix=''
+unsafe-perm=true
diff --git a/js/package.json b/js/package.json
index b03fd8e6f..62803cc70 100644
--- a/js/package.json
+++ b/js/package.json
@@ -26,6 +26,7 @@
"Promise"
],
"scripts": {
+ "install": "napa",
"analize": "npm run analize:lib && npm run analize:dll && npm run analize:app",
"analize:app": "WPANALIZE=1 webpack --config webpack/app --json > .build/analize.app.json && cat .build/analize.app.json | webpack-bundle-size-analyzer",
"analize:lib": "WPANALIZE=1 webpack --config webpack/libraries --json > .build/analize.lib.json && cat .build/analize.lib.json | webpack-bundle-size-analyzer",
@@ -63,6 +64,9 @@
"test:npm": "(cd .npmjs && npm i) && node test/npmParity && node test/npmJsonRpc && (rm -rf .npmjs/node_modules)",
"prepush": "npm run lint:cached"
},
+ "napa": {
+ "qrcode-generator": "kazuhikoarase/qrcode-generator"
+ },
"devDependencies": {
"babel-cli": "6.23.0",
"babel-core": "6.23.1",
@@ -182,10 +186,10 @@
"mobx-react": "4.0.3",
"mobx-react-devtools": "4.2.10",
"moment": "2.17.0",
+ "napa": "2.3.0",
"phoneformat.js": "1.0.3",
"promise-worker": "1.1.1",
"push.js": "0.0.11",
- "qrcode-npm": "0.0.3",
"qs": "6.3.0",
"react": "15.4.2",
"react-ace": "4.1.0",
@@ -198,6 +202,7 @@
"react-intl": "2.1.5",
"react-markdown": "2.4.4",
"react-portal": "3.0.0",
+ "react-qr-reader": "1.0.3",
"react-redux": "4.4.6",
"react-router": "3.0.0",
"react-router-redux": "4.0.7",
diff --git a/js/src/api/rpc/eth/eth.js b/js/src/api/rpc/eth/eth.js
index 824486ade..ffde938ea 100644
--- a/js/src/api/rpc/eth/eth.js
+++ b/js/src/api/rpc/eth/eth.js
@@ -288,9 +288,9 @@ export default class Eth {
.execute('eth_sign', inAddress(address), inHash(hash));
}
- signTransaction () {
+ signTransaction (options) {
return this._transport
- .execute('eth_signTransaction');
+ .execute('eth_signTransaction', inOptions(options));
}
submitHashrate (hashrate, clientId) {
diff --git a/js/src/modals/CreateAccount/AccountDetails/accountDetails.js b/js/src/modals/CreateAccount/AccountDetails/accountDetails.js
index 9e5b08b38..75a2ca9c4 100644
--- a/js/src/modals/CreateAccount/AccountDetails/accountDetails.js
+++ b/js/src/modals/CreateAccount/AccountDetails/accountDetails.js
@@ -25,11 +25,11 @@ import styles from '../createAccount.css';
@observer
export default class AccountDetails extends Component {
static propTypes = {
- store: PropTypes.object.isRequired
+ createStore: PropTypes.object.isRequired
}
render () {
- const { address, description, name } = this.props.store;
+ const { address, description, name } = this.props.createStore;
return (
@@ -79,7 +79,7 @@ export default class AccountDetails extends Component {
}
renderPhrase () {
- const { phrase } = this.props.store;
+ const { phrase } = this.props.createStore;
if (!phrase) {
return null;
diff --git a/js/src/modals/CreateAccount/AccountDetails/accountDetails.spec.js b/js/src/modals/CreateAccount/AccountDetails/accountDetails.spec.js
index 02b755952..99e1837cb 100644
--- a/js/src/modals/CreateAccount/AccountDetails/accountDetails.spec.js
+++ b/js/src/modals/CreateAccount/AccountDetails/accountDetails.spec.js
@@ -28,7 +28,7 @@ function render () {
store = createStore();
component = shallow(
);
diff --git a/js/src/modals/CreateAccount/AccountDetailsGeth/accountDetailsGeth.js b/js/src/modals/CreateAccount/AccountDetailsGeth/accountDetailsGeth.js
index 7e2e89f3d..37a872e0e 100644
--- a/js/src/modals/CreateAccount/AccountDetailsGeth/accountDetailsGeth.js
+++ b/js/src/modals/CreateAccount/AccountDetailsGeth/accountDetailsGeth.js
@@ -26,11 +26,11 @@ import styles from '../createAccount.css';
@observer
export default class AccountDetailsGeth extends Component {
static propTypes = {
- store: PropTypes.object.isRequired
+ createStore: PropTypes.object.isRequired
}
render () {
- const { gethAccountsAvailable, gethImported } = this.props.store;
+ const { gethAccountsAvailable, gethImported } = this.props.createStore;
const accounts = gethAccountsAvailable.filter((account) => gethImported.includes(account.address));
diff --git a/js/src/modals/CreateAccount/AccountDetailsGeth/accountDetailsGeth.spec.js b/js/src/modals/CreateAccount/AccountDetailsGeth/accountDetailsGeth.spec.js
index b5813e9fa..6099202cf 100644
--- a/js/src/modals/CreateAccount/AccountDetailsGeth/accountDetailsGeth.spec.js
+++ b/js/src/modals/CreateAccount/AccountDetailsGeth/accountDetailsGeth.spec.js
@@ -28,7 +28,7 @@ function render () {
store = createStore();
component = shallow(
);
diff --git a/js/src/modals/CreateAccount/ChangeVault/changeVault.js b/js/src/modals/CreateAccount/ChangeVault/changeVault.js
index 566fa402c..510251cb2 100644
--- a/js/src/modals/CreateAccount/ChangeVault/changeVault.js
+++ b/js/src/modals/CreateAccount/ChangeVault/changeVault.js
@@ -22,13 +22,13 @@ import { VaultSelect } from '~/ui';
@observer
export default class ChangeVault extends Component {
static propTypes = {
- store: PropTypes.object.isRequired,
+ createStore: PropTypes.object.isRequired,
vaultStore: PropTypes.object
}
render () {
- const { store, vaultStore } = this.props;
- const { vaultName } = store;
+ const { createStore, vaultStore } = this.props;
+ const { vaultName } = createStore;
if (!vaultStore || vaultStore.vaultsOpened.length === 0) {
return null;
@@ -44,8 +44,8 @@ export default class ChangeVault extends Component {
}
onSelect = (vaultName) => {
- const { store } = this.props;
+ const { createStore } = this.props;
- store.setVaultName(vaultName);
+ createStore.setVaultName(vaultName);
}
}
diff --git a/js/src/modals/CreateAccount/ChangeVault/changeVault.spec.js b/js/src/modals/CreateAccount/ChangeVault/changeVault.spec.js
index a2fcb834b..789facf8e 100644
--- a/js/src/modals/CreateAccount/ChangeVault/changeVault.spec.js
+++ b/js/src/modals/CreateAccount/ChangeVault/changeVault.spec.js
@@ -45,7 +45,7 @@ function createVaultStore () {
function render () {
component = shallow(
);
diff --git a/js/src/modals/CreateAccount/CreationType/creationType.js b/js/src/modals/CreateAccount/CreationType/creationType.js
index a7d23a667..8869e6e63 100644
--- a/js/src/modals/CreateAccount/CreationType/creationType.js
+++ b/js/src/modals/CreateAccount/CreationType/creationType.js
@@ -54,6 +54,21 @@ const TYPES = [
),
key: 'fromPhrase'
},
+ {
+ description: (
+
+ ),
+ label: (
+
+ ),
+ key: 'fromQr'
+ },
{
description: (
- ),
- label: (
-
- ),
- key: 'fromPresale'
- },
{
description: (
),
key: 'fromRaw'
+ },
+ {
+ description: (
+
+ ),
+ label: (
+
+ ),
+ key: 'fromPresale'
}
];
@observer
export default class CreationType extends Component {
static propTypes = {
- store: PropTypes.object.isRequired
+ createStore: PropTypes.object.isRequired
}
render () {
- const { createType } = this.props.store;
+ const { createType } = this.props.createStore;
return (
@@ -157,7 +172,7 @@ export default class CreationType extends Component {
{
- const { createType } = this.props.store;
+ const { createType } = this.props.createStore;
return item.key === createType;
}
onChange = (item) => {
- const { store } = this.props;
+ const { createStore } = this.props;
- store.setCreateType(item.key);
+ createStore.setCreateType(item.key);
}
onSelect = (item) => {
- const { store } = this.props;
+ const { createStore } = this.props;
- store.setCreateType(item.key);
- store.nextStage();
+ createStore.setCreateType(item.key);
+ createStore.nextStage();
}
}
diff --git a/js/src/modals/CreateAccount/CreationType/creationType.spec.js b/js/src/modals/CreateAccount/CreationType/creationType.spec.js
index 6b3f739c7..ddeaecae4 100644
--- a/js/src/modals/CreateAccount/CreationType/creationType.spec.js
+++ b/js/src/modals/CreateAccount/CreationType/creationType.spec.js
@@ -29,7 +29,7 @@ function render () {
store = createStore();
component = shallow(
);
instance = component.instance();
diff --git a/js/src/modals/CreateAccount/NewAccount/newAccount.js b/js/src/modals/CreateAccount/NewAccount/newAccount.js
index e0a2f8ba2..04f2f272a 100644
--- a/js/src/modals/CreateAccount/NewAccount/newAccount.js
+++ b/js/src/modals/CreateAccount/NewAccount/newAccount.js
@@ -31,7 +31,7 @@ import styles from '../createAccount.css';
export default class CreateAccount extends Component {
static propTypes = {
newError: PropTypes.func.isRequired,
- store: PropTypes.object.isRequired,
+ createStore: PropTypes.object.isRequired,
vaultStore: PropTypes.object
}
@@ -45,7 +45,7 @@ export default class CreateAccount extends Component {
}
render () {
- const { name, nameError, password, passwordRepeat, passwordRepeatError, passwordHint } = this.props.store;
+ const { name, nameError, password, passwordRepeat, passwordRepeatError, passwordHint } = this.props.createStore;
return (
{ this.renderIdentitySelector() }
@@ -203,16 +203,16 @@ export default class CreateAccount extends Component {
}
createIdentities = () => {
- const { store } = this.props;
+ const { createStore } = this.props;
- return store
+ return createStore
.createIdentities()
.then((accounts) => {
const selectedAddress = Object.keys(accounts)[0];
const { phrase } = accounts[selectedAddress];
- store.setAddress(selectedAddress);
- store.setPhrase(phrase);
+ createStore.setAddress(selectedAddress);
+ createStore.setPhrase(phrase);
this.setState({
accounts,
@@ -225,7 +225,7 @@ export default class CreateAccount extends Component {
}
onChangeIdentity = (event) => {
- const { store } = this.props;
+ const { createStore } = this.props;
const selectedAddress = event.target.value || event.target.getAttribute('value');
if (!selectedAddress) {
@@ -235,32 +235,32 @@ export default class CreateAccount extends Component {
this.setState({ selectedAddress }, () => {
const { phrase } = this.state.accounts[selectedAddress];
- store.setAddress(selectedAddress);
- store.setPhrase(phrase);
+ createStore.setAddress(selectedAddress);
+ createStore.setPhrase(phrase);
});
}
onEditPasswordHint = (event, passwordHint) => {
- const { store } = this.props;
+ const { createStore } = this.props;
- store.setPasswordHint(passwordHint);
+ createStore.setPasswordHint(passwordHint);
}
onEditAccountName = (event, name) => {
- const { store } = this.props;
+ const { createStore } = this.props;
- store.setName(name);
+ createStore.setName(name);
}
onEditPassword = (event, password) => {
- const { store } = this.props;
+ const { createStore } = this.props;
- store.setPassword(password);
+ createStore.setPassword(password);
}
onEditPasswordRepeat = (event, password) => {
- const { store } = this.props;
+ const { createStore } = this.props;
- store.setPasswordRepeat(password);
+ createStore.setPasswordRepeat(password);
}
}
diff --git a/js/src/modals/CreateAccount/NewAccount/newAccount.spec.js b/js/src/modals/CreateAccount/NewAccount/newAccount.spec.js
index 246467e47..87c7ba3fc 100644
--- a/js/src/modals/CreateAccount/NewAccount/newAccount.spec.js
+++ b/js/src/modals/CreateAccount/NewAccount/newAccount.spec.js
@@ -32,7 +32,7 @@ function render () {
store = createStore();
component = shallow(
,
{
context: { api }
diff --git a/js/src/modals/CreateAccount/NewGeth/newGeth.js b/js/src/modals/CreateAccount/NewGeth/newGeth.js
index 26f11d6a7..54c0acb50 100644
--- a/js/src/modals/CreateAccount/NewGeth/newGeth.js
+++ b/js/src/modals/CreateAccount/NewGeth/newGeth.js
@@ -30,11 +30,11 @@ export default class NewGeth extends Component {
}
static propTypes = {
- store: PropTypes.object.isRequired
+ createStore: PropTypes.object.isRequired
}
render () {
- const { gethAccountsAvailable, gethAddresses } = this.props.store;
+ const { gethAccountsAvailable, gethAddresses } = this.props.createStore;
return gethAccountsAvailable.length
? (
@@ -84,14 +84,14 @@ export default class NewGeth extends Component {
}
isSelected = (account) => {
- const { gethAddresses } = this.props.store;
+ const { gethAddresses } = this.props.createStore;
return gethAddresses.includes(account.address);
}
onSelect = (account) => {
- const { store } = this.props;
+ const { createStore } = this.props;
- store.selectGethAccount(account.address);
+ createStore.selectGethAccount(account.address);
}
}
diff --git a/js/src/modals/CreateAccount/NewGeth/newGeth.spec.js b/js/src/modals/CreateAccount/NewGeth/newGeth.spec.js
index 6acc8be16..b25eb7d01 100644
--- a/js/src/modals/CreateAccount/NewGeth/newGeth.spec.js
+++ b/js/src/modals/CreateAccount/NewGeth/newGeth.spec.js
@@ -30,7 +30,7 @@ function render () {
store = createStore();
component = shallow(
);
instance = component.instance();
diff --git a/js/src/modals/CreateAccount/NewImport/newImport.js b/js/src/modals/CreateAccount/NewImport/newImport.js
index e3d888c3f..f683e7c5d 100644
--- a/js/src/modals/CreateAccount/NewImport/newImport.js
+++ b/js/src/modals/CreateAccount/NewImport/newImport.js
@@ -26,13 +26,13 @@ import styles from '../createAccount.css';
@observer
export default class NewImport extends Component {
static propTypes = {
- store: PropTypes.object.isRequired,
+ createStore: PropTypes.object.isRequired,
vaultStore: PropTypes.object
}
render () {
- const { name, nameError, password, passwordHint } = this.props.store;
+ const { name, nameError, password, passwordHint } = this.props.createStore;
return (