From 95be4193c9e3f83776cf5c462871f7a5b5239b58 Mon Sep 17 00:00:00 2001 From: Jordan Muir Date: Fri, 2 Oct 2020 06:22:24 -0400 Subject: [PATCH 01/24] Add xDai --- app/App/Panel/Local/index.js | 4 +- app/App/Panel/Main/index.js | 9 +-- app/App/Panel/index.js | 4 +- main/index.js | 6 +- main/signers/hot/HotSigner/worker.js | 4 +- main/signers/ledger-ble/LedgerBLE/index.js | 4 +- main/signers/ledger/Ledger/index.js | 6 +- main/signers/trezor-connect/Trezor/index.js | 4 +- main/store/state/index.js | 78 +++++++++++++++++++++ 9 files changed, 90 insertions(+), 29 deletions(-) diff --git a/app/App/Panel/Local/index.js b/app/App/Panel/Local/index.js index 996466f7f..818e94416 100644 --- a/app/App/Panel/Local/index.js +++ b/app/App/Panel/Local/index.js @@ -159,9 +159,11 @@ class Settings extends React.Component { onChange={(network) => this.selectNetwork(network)} options={[ { text: 'Mainnet', value: '1' }, + { text: 'xDai', value: '100' }, { text: 'Ropsten', value: '3' }, { text: 'Rinkeby', value: '4' }, - { text: 'Kovan', value: '42' }]} + { text: 'Kovan', value: '42' } + ]} /> {/*
diff --git a/app/App/Panel/Main/index.js b/app/App/Panel/Main/index.js index a75a83559..2d9c8b975 100644 --- a/app/App/Panel/Main/index.js +++ b/app/App/Panel/Main/index.js @@ -8,13 +8,6 @@ import Add from './Add' import svg from '../../../svg' -const accountNames = { - 1: 'Mainnet', - 3: 'Ropsten', - 4: 'Rinkeby', - 42: 'Kovan' -} - let firstScroll = true class Main extends React.Component { @@ -68,7 +61,7 @@ class Main extends React.Component { {Object.keys(accounts).length === 0 && Object.keys(signers).length === 0 ? (
{svg.logo(70)}
- {`No ${accountNames[network]} Accounts Found`} + {`No ${this.store('main.networks', network, 'name')} Accounts Found`} this.store.notify('intro')}>Need help getting started? diff --git a/app/App/Panel/index.js b/app/App/Panel/index.js index 4d6b29891..6298092d6 100644 --- a/app/App/Panel/index.js +++ b/app/App/Panel/index.js @@ -10,8 +10,6 @@ import Badge from './Badge' // import DevTools from 'restore-devtools' // -const networks = { 1: 'Mainnet', 3: 'Ropsten', 4: 'Rinkeby', 42: 'Kovan' } - class Panel extends React.Component { indicator (connection) { const status = [connection.local.status, connection.secondary.status] @@ -35,7 +33,7 @@ class Panel extends React.Component {
{this.indicator(this.store('main.connection'))}
-
{networks[this.store('main.connection.network')]}
+
{this.store('main.networks', this.store('main.connection.network'), 'name')}
this.store.toggleSettings()}> {svg.octicon('chevron-right', { height: 14 })} diff --git a/main/index.js b/main/index.js index 6d5dcf68c..26bdca2ab 100644 --- a/main/index.js +++ b/main/index.js @@ -95,12 +95,10 @@ ipcMain.on('tray:openExternal', (e, url) => { if (externalWhitelist.indexOf(url) > -1) shell.openExternal(url) }) -// TODO: Custom networks link to custom explorers -const networks = { 1: '', 3: 'ropsten.', 4: 'rinkeby.', 5: 'goerli.', 42: 'kovan.' } ipcMain.on('tray:openEtherscan', (e, hash) => { const id = store('main.connection.network') - const network = networks[id] - shell.openExternal('https://' + network + 'etherscan.io/tx/' + hash) + const explorer = store('main.networks', id, 'explorer') + shell.openExternal(explorer + '/tx/' + hash) }) ipcMain.on('tray:giveAccess', (e, req, access) => { diff --git a/main/signers/hot/HotSigner/worker.js b/main/signers/hot/HotSigner/worker.js index 046bbcae2..8e850835a 100644 --- a/main/signers/hot/HotSigner/worker.js +++ b/main/signers/hot/HotSigner/worker.js @@ -5,8 +5,6 @@ const EthTx = require('ethereumjs-tx').Transaction const { signTypedData } = require('../../../crypt/typedDataUtils') -const chains = { 1: 'mainnet', 3: 'ropsten', 4: 'rinkeby', 42: 'kovan' } - class HotSignerWorker { constructor () { this.token = crypto.randomBytes(32).toString('hex') @@ -51,7 +49,7 @@ class HotSignerWorker { } signTransaction (key, rawTx, pseudoCallback) { - const chain = chains[parseInt(rawTx.chainId)] + const chain = parseInt(rawTx.chainId) // Create tranasction const tx = new EthTx(rawTx, { chain }) // Sign transaction diff --git a/main/signers/ledger-ble/LedgerBLE/index.js b/main/signers/ledger-ble/LedgerBLE/index.js index 5045078e9..1fcc60f08 100644 --- a/main/signers/ledger-ble/LedgerBLE/index.js +++ b/main/signers/ledger-ble/LedgerBLE/index.js @@ -6,8 +6,6 @@ const Signer = require('../../Signer') const windows = require('../../../windows') const flex = require('../../../flex') -const chains = { 1: 'mainnet', 3: 'ropsten', 4: 'rinkeby', 42: 'kovan' } - class LedgerBLE extends Signer { constructor (device, api) { super() @@ -236,7 +234,7 @@ class LedgerBLE extends Signer { v: this.hexToBuffer(result.v), r: this.hexToBuffer(result.r), s: this.hexToBuffer(result.s) - }, { chain: chains[parseInt(rawTx.chainId)] }) + }, { chain: parseInt(rawTx.chainId) }) cb(null, '0x' + tx.serialize().toString('hex')) }) } diff --git a/main/signers/ledger/Ledger/index.js b/main/signers/ledger/Ledger/index.js index 6ba24e2f5..bde57b3a3 100644 --- a/main/signers/ledger/Ledger/index.js +++ b/main/signers/ledger/Ledger/index.js @@ -13,8 +13,6 @@ const BASE_PATH_LEGACY = '44\'/60\'/0\'/' const BASE_PATH_LIVE = '44\'/60\'/' const BASE_PATH_TEST = '44\'/1\'/0\'/' -const chains = { 1: 'mainnet', 3: 'ropsten', 4: 'rinkeby', 42: 'kovan' } - class Ledger extends Signer { constructor (devicePath, signers) { super() @@ -272,7 +270,7 @@ class Ledger extends Signer { if (this.pause) throw new Error('Device access is paused') const eth = await this.getDevice() if (parseInt(this.network) !== utils.hexToNumber(rawTx.chainId)) throw new Error('Signer signTx network mismatch') - const tx = new EthereumTx(rawTx, { chain: chains[parseInt(rawTx.chainId)] }) + const tx = new EthereumTx(rawTx, { chain: parseInt(rawTx.chainId) }) tx.raw[6] = Buffer.from([rawTx.chainId]) // v tx.raw[7] = Buffer.from([]) // r tx.raw[8] = Buffer.from([]) // s @@ -289,7 +287,7 @@ class Ledger extends Signer { v: Buffer.from(this.normalize(result.v), 'hex'), r: Buffer.from(this.normalize(result.r), 'hex'), s: Buffer.from(this.normalize(result.s), 'hex') - }, { chain: chains[parseInt(rawTx.chainId)] }) + }, { chain: parseInt(rawTx.chainId) }) cb(null, '0x' + _tx.serialize().toString('hex')) this.releaseDevice() } catch (err) { diff --git a/main/signers/trezor-connect/Trezor/index.js b/main/signers/trezor-connect/Trezor/index.js index 100981aed..c4f38dd3f 100644 --- a/main/signers/trezor-connect/Trezor/index.js +++ b/main/signers/trezor-connect/Trezor/index.js @@ -7,8 +7,6 @@ const flex = require('../../../flex') const { v5: uuid } = require('uuid') const ns = '3bbcee75-cecc-5b56-8031-b6641c1ed1f1' -const chains = { 1: 'mainnet', 3: 'ropsten', 4: 'rinkeby', 42: 'kovan' } - class Trezor extends Signer { constructor (device, signers) { super() @@ -208,7 +206,7 @@ class Trezor extends Signer { v: this.hexToBuffer(result.v), r: this.hexToBuffer(result.r), s: this.hexToBuffer(result.s) - }, { chain: chains[parseInt(rawTx.chainId)] }) + }, { chain: parseInt(rawTx.chainId) }) cb(null, '0x' + tx.serialize().toString('hex')) }) } diff --git a/main/store/state/index.js b/main/store/state/index.js index 9c0b53ba7..db010c0a5 100644 --- a/main/store/state/index.js +++ b/main/store/state/index.js @@ -112,6 +112,44 @@ const initial = { state: 'off' } }, + networks: { + 1: { + type: 'ethereum', + slug: 'mainnet', + name: 'Mainnet', + explorer: 'https://etherscan.io' + }, + 3: { + type: 'ethereum', + slug: 'ropsten', + name: 'Ropsten', + explorer: 'https://ropsten.etherscan.io' + }, + 4: { + type: 'ethereum', + slug: 'rinkeby', + name: 'Rinkeby', + explorer: 'https://rinkeby.etherscan.io' + }, + 42: { + type: 'ethereum', + slug: 'kovan', + name: 'Kovan', + explorer: 'https://kovan.etherscan.io' + }, + // 74: { + // type: 'ethereum', + // slug: 'idchain', + // name: 'IDChain', + // explorer: 'https://explorer.idchain.one' + // }, + 100: { + type: 'ethereum', + slug: 'xdai', + name: 'xDai', + explorer: 'https://blockscout.com/poa/xdai' + } + }, gasPrice: main('gasPrice', { 1: { default: 'standard', @@ -128,6 +166,14 @@ const initial = { 42: { default: 'standard', levels: { safelow: '', standard: '', fast: '', trader: '', custom: '' } + }, + // 74: { + // default: 'standard', + // levels: { safelow: '', standard: '', fast: '', trader: '', custom: '' } + // }, + 100: { + default: 'standard', + levels: { safelow: '', standard: '', fast: '', trader: '', custom: '' } } }), connection: { @@ -165,6 +211,22 @@ const initial = { custom: main('connection.local.settings.42.options.custom', ''), local: 'direct' } + }, + // 74: { + // current: main('connection.local.settings.74.current', 'idchain'), + // options: { + // idchain: 'https://idchain.one/api/eth_rpc', + // custom: main('connection.local.settings.74.options.custom', ''), + // local: 'direct' + // } + // }, + 100: { + current: main('connection.local.settings.100.current', 'poa'), + options: { + poa: 'https://dai.poa.network', + custom: main('connection.local.settings.100.options.custom', ''), + local: 'direct' + } } }, on: main('connection.local.on', true), @@ -206,6 +268,22 @@ const initial = { custom: main('connection.secondary.settings.42.options.custom', ''), local: 'direct' } + }, + // 74: { + // current: main('connection.secondary.settings.74.current', 'idchain'), + // options: { + // idchain: 'https://idchain.one/api/eth_rpc', + // custom: main('connection.secondary.settings.74.options.custom', ''), + // local: 'direct' + // } + // }, + 100: { + current: main('connection.secondary.settings.100.current', 'poa'), + options: { + poa: 'https://dai.poa.network', + custom: main('connection.secondary.settings.100.options.custom', ''), + local: 'direct' + } } }, on: main('connection.secondary.on', false), From 6311d34b23337e4c958a31f1977e31e8437a2d6b Mon Sep 17 00:00:00 2001 From: Jordan Muir Date: Mon, 5 Oct 2020 06:57:22 -0400 Subject: [PATCH 02/24] Network settings interface --- app/App/Panel/Local/index.js | 13 +- app/App/Panel/Local/style/index.styl | 22 ++ app/App/Panel/Notify/index.js | 169 +++++++++++- app/App/Panel/Notify/style/index.styl | 144 +++++++++- app/svg/index.js | 20 +- main/store/state/index.js | 83 +++--- package-lock.json | 366 +++++++++++++------------- 7 files changed, 591 insertions(+), 226 deletions(-) diff --git a/app/App/Panel/Local/index.js b/app/App/Panel/Local/index.js index 818e94416..f57ba4e67 100644 --- a/app/App/Panel/Local/index.js +++ b/app/App/Panel/Local/index.js @@ -1,6 +1,7 @@ import React from 'react' import Restore from 'react-restore' import link from '../../../link' +import svg from '../../../svg' // import Client from '../Client' import Dropdown from '../../Components/Dropdown' @@ -147,6 +148,9 @@ class Settings extends React.Component { primaryOptions = Object.keys(primaryOptions).map(i => ({ text: i, value: i })) secondaryOptions = Object.keys(secondaryOptions).map(i => ({ text: i, value: i })) + let networks = this.store('main.networks') + let networkOptions = Object.keys(networks).map(i => ({ text: networks[i].name, value: i })) + return (
this.expandNetwork(e, false)}>
@@ -154,16 +158,11 @@ class Settings extends React.Component {
Connection
+
this.store.notify('editNetworks')}>{svg.broadcast(16)}
this.selectNetwork(network)} - options={[ - { text: 'Mainnet', value: '1' }, - { text: 'xDai', value: '100' }, - { text: 'Ropsten', value: '3' }, - { text: 'Rinkeby', value: '4' }, - { text: 'Kovan', value: '42' } - ]} + options={networkOptions} />
{/*
diff --git a/app/App/Panel/Local/style/index.styl b/app/App/Panel/Local/style/index.styl index 211b6b390..251743268 100644 --- a/app/App/Panel/Local/style/index.styl +++ b/app/App/Panel/Local/style/index.styl @@ -10,6 +10,28 @@ transition standard transform translateZ(0) + .localSettingsAddChain + position absolute + right 130px + display flex + justify-content center + align-items center + height 26px + z-index 9999999 + border-radius 13px + // letter-spacing 1px + height 26px + font-weight 200 + width 26px + font-size 23px + text-transform uppercase + background highlight + overflow hidden + box-shadow cardDrop, 0px 2px 1px thick + padding 0px 0px 0px 0px + transition standard + transform translateZ(0) + .localSettingsWrapFadeTop position absolute background red diff --git a/app/App/Panel/Notify/index.js b/app/App/Panel/Notify/index.js index 62801666b..8fa351917 100644 --- a/app/App/Panel/Notify/index.js +++ b/app/App/Panel/Notify/index.js @@ -3,11 +3,77 @@ import Restore from 'react-restore' import svg from '../../../svg' import link from '../../../link' +class Network extends React.Component { + constructor (...args) { + super(...args) + const { id, name, explorer } = this.props + this.state = { id, name, explorer } + } + render () { + const changed = ( + this.props.id !== this.state.id || + this.props.name !== this.state.name || + this.props.explorer !== this.state.explorer + ) + return ( +
+ {changed ? ( +
{svg.save(16)}
+ ):( +
{svg.octicon('x', { height: 16 })}
+ )} +
+ { + this.setState({ name: e.target.value }) + }} + onBlur={(e) => { + if (e.target.value === '') this.setState({ name: this.props.name }) + }} + /> +
+
+ { + this.setState({ id: e.target.value }) + }} + onBlur={(e) => { + if (e.target.value === '') this.setState({ id: this.props.id }) + }} + /> +
+
+ { + this.setState({ explorer: e.target.value }) + }} + onBlur={(e) => { + if (e.target.value === '') this.setState({ explorer: this.props.explorer }) + }} + /> +
+
+ ) + } +} + class Notify extends React.Component { + constructor (...args) { + super(...args) + this.newNetworkIdDefault = 'ID' + this.newNetworkNameDefault = 'New Network' + this.newNetworkExplorerDefault = 'Block Explorer' + this.state = { + newNetworkId: this.newNetworkIdDefault, + newNetworkName: this.newNetworkNameDefault, + newNetworkExplorer: this.newNetworkExplorerDefault + } + } + intro () { return (
-
this.store.notify()}>{svg.octicon('x', { height: 18 })}
+
this.store.notify()}>{svg.octicon('x', { height: 22 })}
e.stopPropagation()}>
{'Getting Started'} @@ -291,6 +357,106 @@ class Notify extends React.Component { ) } + renderNetworks () { + const networks = this.store('main.networks') + return Object.keys(networks).map(id => { + return + }) + } + + editNetworks () { + const changedNewNetwork = ( + this.state.newNetworkId !== this.newNetworkIdDefault || + this.state.newNetworkName !== this.newNetworkNameDefault || + this.state.newNetworkExplorer !== this.newNetworkExplorerDefault + ) + + const newNetworkReady = ( + this.state.newNetworkId !== this.newNetworkIdDefault && this.state.newNetworkId !== '' && + this.state.newNetworkName !== this.newNetworkNameDefault && this.state.newNetworkName !== '' && + this.state.newNetworkExplorer !== this.newNetworkExplorerDefault && this.state.newNetworkExplorer !== '' + ) + + return ( +
+
e.stopPropagation()}> +
+ {'Networks'} +
+
+
+ {this.renderNetworks()} +
+ {changedNewNetwork ? ( + newNetworkReady ? ( +
+ {svg.save(18)} +
+ ):( +
+ {svg.octicon('check', { height: 19 })} +
+ ) + ):( +
+ {svg.octicon('plus', { height: 17 })} +
+ )} +
+ { + this.setState({ newNetworkName: e.target.value }) + }} + onFocus={(e) => { + if (e.target.value === this.newNetworkNameDefault) this.setState({ newNetworkName: '' }) + }} + onBlur={(e) => { + if (e.target.value === '') this.setState({ newNetworkName: this.newNetworkNameDefault }) + }} + /> +
+
+ { + if (Number(parseInt(e.target.value)) || e.target.value === '') { + this.setState({ newNetworkId: e.target.value }) + } + }} + onFocus={(e) => { + console.log(e.target.value, this.newNetworkIdDefault) + if (e.target.value === this.newNetworkIdDefault) this.setState({ newNetworkId: '' }) + }} + onBlur={(e) => { + if (e.target.value === '') this.setState({ newNetworkId: this.newNetworkIdDefault }) + }} + /> +
+
+ { + this.setState({ newNetworkExplorer: e.target.value }) + }} + onFocus={(e) => { + if (e.target.value === this.newNetworkExplorerDefault) this.setState({ newNetworkExplorer: '' }) + }} + onBlur={(e) => { + if (e.target.value === '') this.setState({ newNetworkExplorer: this.newNetworkExplorerDefault }) + }} + /> +
+
+
+
+
{ this.store.notify() }}> +
Close
+
+
+
+
+
+ ) + } + render () { // Instead of mounting all of these we should use a transition to mount and animate on demand return (
this.store.notify()}> @@ -305,6 +471,7 @@ class Notify extends React.Component { {this.contractData()} {this.hotAccountWarning()} {this.hotSignerMismatch()} + {this.editNetworks()}
) } diff --git a/app/App/Panel/Notify/style/index.styl b/app/App/Panel/Notify/style/index.styl index afdbcba93..ac881a38e 100644 --- a/app/App/Panel/Notify/style/index.styl +++ b/app/App/Panel/Notify/style/index.styl @@ -12,6 +12,9 @@ align-items center text-align center opacity 1 + + ::selection + background good02 // #ffb7b7 .notifyBox:before content '' @@ -56,7 +59,9 @@ padding 55px 20px 60px 20px border-top 1px solid lightShade border-bottom 1px solid lightShade - + min-width 100% + overflow hidden + .notifyTitle font-size 32px position relative @@ -74,6 +79,143 @@ .notifyBodyLine margin-bottom 40px + .notifyNetwork + width 100% + height 480px + overflow-y scroll + padding-bottom 0px + background thin + margin -20px 0px 20px 0px + // margin-bottom 20px + border-radius 24px + + input + position absolute + top 0 + left 0 + right 0 + bottom 0 + width 100% + height 100% + border none + outline none + background transparent + text-align center + font-size 16px + // font-weight 300 + font-family Raleway, sans-serif + padding 0px 10px 0px 10px + + .notifyNetworkLine:before + content '' + position absolute + top 0 + left 0 + right 0 + bottom 2px + background highlight + z-index 2 + border-radius 16px + + .notifyNetworkLine + position relative + margin 10px + height 80px + overflow hidden + background lightShade + padding-top 1px + // box-shadow 0px 8px 30px -10px rgba(6, 54, 52, 0.25) + border-radius 16px + + div + z-index 3 + display flex + justify-content center + align-items center + + // .notifyNetworkRemove + // position absolute + // right 0 + // top 0 + // bottom 40px + // width 60px + + .notifyNetworkRemove:hover + background bad + svg + color white + + .notifyNetworkSubmit + position absolute + right 0 + top 0 + bottom 40px + width 60px + color outerspace + svg + color outerspace + + // .notifyNetworkSubmitEnabled + // background good + // svg + // color white + // filter drop-shadow(0px 2px 1px goodShade) + + .notifyNetworkSubmitEnabled:hover + background good + svg + color white + filter drop-shadow(0px 2px 1px goodShade) + + // .notifyNetworkSubmitDisabled + // // background bad + // svg + // color white + // // filter drop-shadow(0px 2px 1px badShade) + + // .notifyNetworkSubmitDisabled:hover + // background good + // svg + // color white + + .notifyNetworkName + position absolute + top 0 + left 60px + right 60px + bottom 40px + border-left 1px solid lightShade + border-right 1px solid lightShade + + input + font-size 20px + + .notifyNetworkName:hover + background highlighter + + .notifyNetworkId + position absolute + left 0 + top 0 + bottom 40px + width 60px + // background gray + + .notifyNetworkId:hover + background highlighter + + .notifyNetworkExplorer + position absolute + right 0 + left 0 + top 40px + bottom 2px + border-top 1px solid lightShade + font-size 14px + + .notifyNetworkExplorer:hover + background highlighter + .notifyInput display flex position relative diff --git a/app/svg/index.js b/app/svg/index.js index 4bd7dfd84..4e531ab12 100644 --- a/app/svg/index.js +++ b/app/svg/index.js @@ -157,5 +157,23 @@ module.exports = {
) }, + broadcast: size => { + return ( +
+ + + +
+ ) + }, + save: size => { + return ( +
+ + + +
+ ) + }, octicon: (name, settings) => -} +} \ No newline at end of file diff --git a/main/store/state/index.js b/main/store/state/index.js index db010c0a5..3f924c5da 100644 --- a/main/store/state/index.js +++ b/main/store/state/index.js @@ -115,42 +115,41 @@ const initial = { networks: { 1: { type: 'ethereum', - slug: 'mainnet', name: 'Mainnet', explorer: 'https://etherscan.io' }, 3: { type: 'ethereum', - slug: 'ropsten', name: 'Ropsten', explorer: 'https://ropsten.etherscan.io' }, 4: { type: 'ethereum', - slug: 'rinkeby', name: 'Rinkeby', explorer: 'https://rinkeby.etherscan.io' }, + 5: { + type: 'ethereum', + name: 'Görli', + explorer: 'https://goerli.etherscan.io' + }, 42: { type: 'ethereum', - slug: 'kovan', name: 'Kovan', explorer: 'https://kovan.etherscan.io' }, - // 74: { - // type: 'ethereum', - // slug: 'idchain', - // name: 'IDChain', - // explorer: 'https://explorer.idchain.one' - // }, + 74: { + type: 'ethereum', + name: 'IDChain', + explorer: 'https://explorer.idchain.one' + }, 100: { type: 'ethereum', - slug: 'xdai', name: 'xDai', explorer: 'https://blockscout.com/poa/xdai' } }, - gasPrice: main('gasPrice', { + gasPrice: { 1: { default: 'standard', levels: { safelow: '', standard: '', fast: '', trader: '', custom: '' } @@ -163,19 +162,23 @@ const initial = { default: 'standard', levels: { safelow: '', standard: '', fast: '', trader: '', custom: '' } }, + 5: { + default: 'standard', + levels: { safelow: '', standard: '', fast: '', trader: '', custom: '' } + }, 42: { default: 'standard', levels: { safelow: '', standard: '', fast: '', trader: '', custom: '' } }, - // 74: { - // default: 'standard', - // levels: { safelow: '', standard: '', fast: '', trader: '', custom: '' } - // }, + 74: { + default: 'standard', + levels: { safelow: '', standard: '', fast: '', trader: '', custom: '' } + }, 100: { default: 'standard', levels: { safelow: '', standard: '', fast: '', trader: '', custom: '' } } - }), + }, connection: { network: main('connection.network', '1'), local: { @@ -204,6 +207,14 @@ const initial = { local: 'direct' } }, + 5: { + current: main('connection.local.settings.5.current', 'prylabs'), + options: { + prylabs: 'https://goerli.prylabs.net', + custom: main('connection.local.settings.5.options.custom', ''), + local: 'direct' + } + }, 42: { current: main('connection.local.settings.42.current', 'infura'), options: { @@ -212,14 +223,13 @@ const initial = { local: 'direct' } }, - // 74: { - // current: main('connection.local.settings.74.current', 'idchain'), - // options: { - // idchain: 'https://idchain.one/api/eth_rpc', - // custom: main('connection.local.settings.74.options.custom', ''), - // local: 'direct' - // } - // }, + 74: { + current: main('connection.local.settings.74.current', 'custom'), + options: { + custom: main('connection.local.settings.74.options.custom', ''), + local: 'direct' + } + }, 100: { current: main('connection.local.settings.100.current', 'poa'), options: { @@ -261,6 +271,14 @@ const initial = { local: 'direct' } }, + 5: { + current: main('connection.local.settings.5.current', 'prylabs'), + options: { + prylabs: 'https://goerli.prylabs.net', + custom: main('connection.local.settings.5.options.custom', ''), + local: 'direct' + } + }, 42: { current: main('connection.secondary.settings.42.current', 'custom'), options: { @@ -269,14 +287,13 @@ const initial = { local: 'direct' } }, - // 74: { - // current: main('connection.secondary.settings.74.current', 'idchain'), - // options: { - // idchain: 'https://idchain.one/api/eth_rpc', - // custom: main('connection.secondary.settings.74.options.custom', ''), - // local: 'direct' - // } - // }, + 74: { + current: main('connection.secondary.settings.74.current', 'custom'), + options: { + custom: main('connection.secondary.settings.74.options.custom', ''), + local: 'direct' + } + }, 100: { current: main('connection.secondary.settings.100.current', 'poa'), options: { diff --git a/package-lock.json b/package-lock.json index d8336cb9b..a71b396cc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1584,9 +1584,9 @@ } }, "@ethersproject/address": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/@ethersproject/address/-/address-5.0.4.tgz", - "integrity": "sha512-CIjAeG6zNehbpJTi0sgwUvaH2ZICiAV9XkCBaFy5tjuEVFpQNeqd6f+B7RowcNO7Eut+QbhcQ5CVLkmP5zhL9A==", + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/@ethersproject/address/-/address-5.0.5.tgz", + "integrity": "sha512-DpkQ6rwk9jTefrRsJzEm6nhRiJd9pvhn1xN0rw5N/jswXG5r7BLk/GVA0mMAVWAsYfvi2xSc5L41FMox43RYEA==", "requires": { "@ethersproject/bignumber": "^5.0.7", "@ethersproject/bytes": "^5.0.4", @@ -1597,9 +1597,9 @@ } }, "@ethersproject/bignumber": { - "version": "5.0.7", - "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.0.7.tgz", - "integrity": "sha512-wwKgDJ+KA7IpgJwc8Fc0AjKIRuDskKA2cque29/+SgII9/1K/38JpqVNPKIovkLwTC2DDofIyzHcxeaKpMFouQ==", + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.0.8.tgz", + "integrity": "sha512-KXFVAFKS1jdTXYN8BE5Oj+ZfPMh28iRdFeNGBVT6cUFdtiPVqeXqc0ggvBqA3A1VoFFGgM7oAeaagA393aORHA==", "requires": { "@ethersproject/bytes": "^5.0.4", "@ethersproject/logger": "^5.0.5", @@ -1607,25 +1607,25 @@ } }, "@ethersproject/bytes": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.0.4.tgz", - "integrity": "sha512-9R6A6l9JN8x1U4s1dJCR+9h3MZTT3xQofr/Xx8wbDvj6NnY4CbBB0o8ZgHXvR74yV90pY2EzCekpkMBJnRzkSw==", + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.0.5.tgz", + "integrity": "sha512-IEj9HpZB+ACS6cZ+QQMTqmu/cnUK2fYNE6ms/PVxjoBjoxc6HCraLpam1KuRvreMy0i523PLmjN8OYeikRdcUQ==", "requires": { "@ethersproject/logger": "^5.0.5" } }, "@ethersproject/constants": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.0.4.tgz", - "integrity": "sha512-Df32lcXDHPgZRPgp1dgmByNbNe4Ki1QoXR+wU61on5nggQGTqWR1Bb7pp9VtI5Go9kyE/JflFc4Te6o9MvYt8A==", + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.0.5.tgz", + "integrity": "sha512-foaQVmxp2+ik9FrLUCtVrLZCj4M3Ibgkqvh+Xw/vFRSerkjVSYePApaVE5essxhoSlF1U9oXfWY09QI2AXtgKA==", "requires": { "@ethersproject/bignumber": "^5.0.7" } }, "@ethersproject/hash": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.0.4.tgz", - "integrity": "sha512-VCs/bFBU8AQFhHcT1cQH6x7a4zjulR6fJmAOcPxUgrN7bxOQ7QkpBKF+YCDJhFtkLdaljIsr/r831TuWU4Ysfg==", + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.0.5.tgz", + "integrity": "sha512-GpI80/h2HDpfNKpCZoxQJCjOQloGnlD5hM1G+tZe8FQDJhEvFjJoPDuWv+NaYjJfOciKS2Axqc4Q4WamdLoUgg==", "requires": { "@ethersproject/bytes": "^5.0.4", "@ethersproject/keccak256": "^5.0.3", @@ -1634,9 +1634,9 @@ } }, "@ethersproject/keccak256": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.0.3.tgz", - "integrity": "sha512-VhW3mgZMBZlETV6AyOmjNeNG+Pg68igiKkPpat8/FZl0CKnfgQ+KZQZ/ee1vT+X0IUM8/djqnei6btmtbA27Ug==", + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.0.4.tgz", + "integrity": "sha512-GNpiOUm9PGUxFNqOxYKDQBM0u68bG9XC9iOulEQ8I0tOx/4qUpgVzvgXL6ugxr0RY554Gz/NQsVqknqPzUcxpQ==", "requires": { "@ethersproject/bytes": "^5.0.4", "js-sha3": "0.5.7" @@ -1650,31 +1650,31 @@ } }, "@ethersproject/logger": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.0.5.tgz", - "integrity": "sha512-gJj72WGzQhUtCk6kfvI8elTaPOQyMvrMghp/nbz0ivTo39fZ7IjypFh/ySDeUSdBNplAwhzWKKejQhdpyefg/w==" + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.0.6.tgz", + "integrity": "sha512-FrX0Vnb3JZ1md/7GIZfmJ06XOAA8r3q9Uqt9O5orr4ZiksnbpXKlyDzQtlZ5Yv18RS8CAUbiKH9vwidJg1BPmQ==" }, "@ethersproject/properties": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.0.3.tgz", - "integrity": "sha512-wLCSrbywkQgTO6tIF9ZdKsH9AIxPEqAJF/z5xcPkz1DK4mMAZgAXRNw1MrKYhyb+7CqNHbj3vxenNKFavGY/IA==", + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.0.4.tgz", + "integrity": "sha512-UdyX3GqBxFt15B0uSESdDNmhvEbK3ACdDXl2soshoPcneXuTswHDeA0LoPlnaZzhbgk4p6jqb4GMms5C26Qu6A==", "requires": { "@ethersproject/logger": "^5.0.5" } }, "@ethersproject/rlp": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.0.3.tgz", - "integrity": "sha512-Hz4yyA/ilGafASAqtTlLWkA/YqwhQmhbDAq2LSIp1AJNx+wtbKWFAKSckpeZ+WG/xZmT+fw5OFKK7a5IZ4DR5g==", + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.0.4.tgz", + "integrity": "sha512-5qrrZad7VTjofxSsm7Zg/7Dr4ZOln4S2CqiDdOuTv6MBKnXj0CiBojXyuDy52M8O3wxH0CyE924hXWTDV1PQWQ==", "requires": { "@ethersproject/bytes": "^5.0.4", "@ethersproject/logger": "^5.0.5" } }, "@ethersproject/signing-key": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.0.4.tgz", - "integrity": "sha512-I6pJoga1IvhtjYK5yXzCjs4ZpxrVbt9ZRAlpEw0SW9UuV020YfJH5EIVEGR2evdRceS3nAQIggqbsXSkP8Y1Dg==", + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.0.5.tgz", + "integrity": "sha512-Z1wY7JC1HVO4CvQWY2TyTTuAr8xK3bJijZw1a9G92JEmKdv1j255R/0YLBBcFTl2J65LUjtXynNJ2GbArPGi5g==", "requires": { "@ethersproject/bytes": "^5.0.4", "@ethersproject/logger": "^5.0.5", @@ -1683,9 +1683,9 @@ } }, "@ethersproject/strings": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.0.4.tgz", - "integrity": "sha512-azXFHaNkDXzefhr4LVVzzDMFwj3kH9EOKlATu51HjxabQafuUyVLPFgmxRFmCynnAi0Bmmp7nr+qK1pVDgRDLQ==", + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.0.5.tgz", + "integrity": "sha512-JED6WaIV00xM/gvj8vSnd+0VWtDYdidTmavFRCTQakqfz+4tDo6Jz5LHgG+dd45h7ah7ykCHW0C7ZXWEDROCXQ==", "requires": { "@ethersproject/bytes": "^5.0.4", "@ethersproject/constants": "^5.0.4", @@ -1693,9 +1693,9 @@ } }, "@ethersproject/transactions": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.0.5.tgz", - "integrity": "sha512-1Ga/QmbcB74DItggP8/DK1tggu4ErEvwTkIwIlUXUcvIAuRNXXE7kgQhlp+w1xA/SAQFhv56SqCoyqPiiLCvVA==", + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.0.6.tgz", + "integrity": "sha512-htsFhOD+NMBxx676A8ehSuwVV49iqpSB+CkjPZ02tpNew0K6p8g0CZ46Z1ZP946gIHAU80xQ0NACHYrjIUaCFA==", "requires": { "@ethersproject/address": "^5.0.4", "@ethersproject/bignumber": "^5.0.7", @@ -2266,19 +2266,19 @@ } }, "@ledgerhq/devices": { - "version": "5.23.0", - "resolved": "https://registry.npmjs.org/@ledgerhq/devices/-/devices-5.23.0.tgz", - "integrity": "sha512-XR9qTwn14WwN8VSMsYD9NTX/TgkmrTnXEh0pIj6HMRZwFzBPzslExOcXuCm3V9ssgAEAxv3VevfV8UulvvZUXA==", + "version": "5.25.0", + "resolved": "https://registry.npmjs.org/@ledgerhq/devices/-/devices-5.25.0.tgz", + "integrity": "sha512-3wsxVDkUYd5ERA5KVy99wEGbHAkfsuWbQ8b2ruzr8JX9wIxUS8mu1XkdoDt5M+H4jXP9C8ZGj9YT3VsiiIzfxg==", "requires": { - "@ledgerhq/errors": "^5.23.0", - "@ledgerhq/logs": "^5.23.0", + "@ledgerhq/errors": "^5.25.0", + "@ledgerhq/logs": "^5.25.0", "rxjs": "^6.6.3" } }, "@ledgerhq/errors": { - "version": "5.23.0", - "resolved": "https://registry.npmjs.org/@ledgerhq/errors/-/errors-5.23.0.tgz", - "integrity": "sha512-qtpX8aFrUUlYfOMu7BxTvxqUa8CniE+tEBpVEjYUhVbFdVJjM4ouwJD++RtQkMAU2c5jE7xb12WnUnf5BlAgLQ==" + "version": "5.25.0", + "resolved": "https://registry.npmjs.org/@ledgerhq/errors/-/errors-5.25.0.tgz", + "integrity": "sha512-+FyyweA9odaWRwRkS35Wf0n2gC4tGsBlgW6VMhT7m1kcwVzUqNFyQzqMKqYvYEAga0P0X59wE+IAlqokkG7Usg==" }, "@ledgerhq/hw-app-eth": { "version": "5.24.0", @@ -2292,12 +2292,12 @@ } }, "@ledgerhq/hw-transport": { - "version": "5.23.0", - "resolved": "https://registry.npmjs.org/@ledgerhq/hw-transport/-/hw-transport-5.23.0.tgz", - "integrity": "sha512-ICTG3Bst62SkC+lYYFgpKk5G4bAOxeIvptXnTLOhf6VqeN7gdHfiRzZwNPnKzI2pxmcEVbBitgsxEIEQJmDKVA==", + "version": "5.25.0", + "resolved": "https://registry.npmjs.org/@ledgerhq/hw-transport/-/hw-transport-5.25.0.tgz", + "integrity": "sha512-q6hhWWwbSZPmzdTaQMowY+uQYwCC4xRqRQFQFgF6BjZFn2n+AwGOEU9mDmHnjL6XxkQfj8CjWuPJSRRv5OLmlg==", "requires": { - "@ledgerhq/devices": "^5.23.0", - "@ledgerhq/errors": "^5.23.0", + "@ledgerhq/devices": "^5.25.0", + "@ledgerhq/errors": "^5.25.0", "events": "^3.2.0" } }, @@ -2330,14 +2330,14 @@ } }, "@ledgerhq/hw-transport-node-hid-noevents": { - "version": "5.23.2", - "resolved": "https://registry.npmjs.org/@ledgerhq/hw-transport-node-hid-noevents/-/hw-transport-node-hid-noevents-5.23.2.tgz", - "integrity": "sha512-8LiF87iIZWJaXMptXJ64ZnMb5T8Sjq66E6AkjnthCuBCPpz6oex50h5vNLVNNNpa/jGv0na7CADOkQkxyBQKmQ==", - "requires": { - "@ledgerhq/devices": "^5.23.0", - "@ledgerhq/errors": "^5.23.0", - "@ledgerhq/hw-transport": "^5.23.0", - "@ledgerhq/logs": "^5.23.0", + "version": "5.25.0", + "resolved": "https://registry.npmjs.org/@ledgerhq/hw-transport-node-hid-noevents/-/hw-transport-node-hid-noevents-5.25.0.tgz", + "integrity": "sha512-2vC/9xOl/B8cCejxNWZLdzOwd9JvbjHq7SMJdhM9UDAGPcfy1awRRpuPpLQWS1hhM0sck5ejXz63L4xPqWRcdg==", + "requires": { + "@ledgerhq/devices": "^5.25.0", + "@ledgerhq/errors": "^5.25.0", + "@ledgerhq/hw-transport": "^5.25.0", + "@ledgerhq/logs": "^5.25.0", "node-hid": "1.3.0" }, "dependencies": { @@ -2367,9 +2367,9 @@ } }, "@ledgerhq/logs": { - "version": "5.23.0", - "resolved": "https://registry.npmjs.org/@ledgerhq/logs/-/logs-5.23.0.tgz", - "integrity": "sha512-88M8RkVHl44k6MAhfrYhx25opnJV24/2XpuTUVklID11f9rBdE+6RZ9OMs39dyX2sDv7TuzIPi5nTRoCqZMDYw==" + "version": "5.25.0", + "resolved": "https://registry.npmjs.org/@ledgerhq/logs/-/logs-5.25.0.tgz", + "integrity": "sha512-OPlkvufjwJWQR+Jp7C6GaEeub+ZHzh3x0xyQMVLL62O7VGrhpzjwq2il/aLNt687k7mKJ+Vg6lFL1B6gO1ZiIg==" }, "@mrmlnc/readdir-enhanced": { "version": "2.2.1", @@ -2587,9 +2587,9 @@ } }, "@solidity-parser/parser": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.8.0.tgz", - "integrity": "sha512-4Eg1iWe6ZuJC9Ynfd8D2cnu06So0QL6V3i+fgQRqT8twPMr+N+kUvS5K7ILgWpuoAag/jb3r0wBDfmpib+yvaw==" + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.8.1.tgz", + "integrity": "sha512-DF7H6T8I4lo2IZOE2NZwt3631T8j1gjpQLjmvY2xBNK50c4ltslR4XPKwT6RkeSd4+xCAK0GHC/k7sbRDBE4Yw==" }, "@szmarczak/http-timer": { "version": "1.1.2", @@ -2882,9 +2882,9 @@ } }, "@types/babel__core": { - "version": "7.1.9", - "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.9.tgz", - "integrity": "sha512-sY2RsIJ5rpER1u3/aQ8OFSI7qGIy8o1NEEbgb2UaJcvOtXOMpd39ko723NBpjQFg9SIX7TXtjejZVGeIMLhoOw==", + "version": "7.1.10", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.10.tgz", + "integrity": "sha512-x8OM8XzITIMyiwl5Vmo2B1cR1S1Ipkyv4mdlbJjMa1lmuKvKY9FrBbEANIaMlnWn5Rf7uO+rC/VgYabNkE17Hw==", "dev": true, "requires": { "@babel/parser": "^7.1.0", @@ -2895,18 +2895,18 @@ } }, "@types/babel__generator": { - "version": "7.6.1", - "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.1.tgz", - "integrity": "sha512-bBKm+2VPJcMRVwNhxKu8W+5/zT7pwNEqeokFOmbvVSqGzFneNxYcEBro9Ac7/N9tlsaPYnZLK8J1LWKkMsLAew==", + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.2.tgz", + "integrity": "sha512-MdSJnBjl+bdwkLskZ3NGFp9YcXGx5ggLpQQPqtgakVhsWK0hTtNYhjpZLlWQTviGTvF8at+Bvli3jV7faPdgeQ==", "dev": true, "requires": { "@babel/types": "^7.0.0" } }, "@types/babel__template": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.0.2.tgz", - "integrity": "sha512-/K6zCpeW7Imzgab2bLkLEbz0+1JlFSrUMdw7KoIIu+IUdu51GWaBZpd3y1VXGVXzynvGa4DaIaxNZHiON3GXUg==", + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.0.3.tgz", + "integrity": "sha512-uCoznIPDmnickEi6D0v11SBpW0OuVqHJCa7syXqQHy5uktSCreIlt0iglsCnmvz8yCb38hGcWeseA8cWJSwv5Q==", "dev": true, "requires": { "@babel/parser": "^7.1.0", @@ -2914,9 +2914,9 @@ } }, "@types/babel__traverse": { - "version": "7.0.14", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.0.14.tgz", - "integrity": "sha512-8w9szzKs14ZtBVuP6Wn7nMLRJ0D6dfB0VEBEyRgxrZ/Ln49aNMykrghM2FaNn4FJRzNppCSa0Rv9pBRM5Xc3wg==", + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.0.15.tgz", + "integrity": "sha512-Pzh9O3sTK8V6I1olsXpCfj2k/ygO2q1X0vhhnDrEQyYLHZesWz+zMZMVcwXLCYf0U36EtmyYaFGPfXlTtDHe3A==", "dev": true, "requires": { "@babel/types": "^7.3.0" @@ -2985,9 +2985,9 @@ } }, "@types/node": { - "version": "14.11.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.11.1.tgz", - "integrity": "sha512-oTQgnd0hblfLsJ6BvJzzSL+Inogp3lq9fGgqRkMB/ziKMgEUaFl801OncOzUmalfzt14N0oPHMK47ipl+wbTIw==" + "version": "14.11.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.11.2.tgz", + "integrity": "sha512-jiE3QIxJ8JLNcb1Ps6rDbysDhN4xa8DJJvuC9prr6w+1tIh+QAbYyNF3tyiZNLDBIuBCf4KEcV2UvQm/V60xfA==" }, "@types/normalize-package-data": { "version": "2.4.0", @@ -3043,9 +3043,9 @@ } }, "@types/yargs": { - "version": "15.0.5", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.5.tgz", - "integrity": "sha512-Dk/IDOPtOgubt/IaevIUbTgV7doaKkoorvOyYM2CMwuDyP89bekI7H4xLIwunNYiK9jhCkmc6pUrJk3cj2AB9w==", + "version": "15.0.7", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.7.tgz", + "integrity": "sha512-Gf4u3EjaPNcC9cTu4/j2oN14nSVhr8PQ+BvBcBQHAhDZfl0bVIiLgvnRXv/dn58XhTm9UXvBpvJpDlwV65QxOA==", "dev": true, "requires": { "@types/yargs-parser": "*" @@ -3455,20 +3455,20 @@ }, "dependencies": { "es-abstract": { - "version": "1.17.6", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz", - "integrity": "sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw==", + "version": "1.17.7", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", + "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", "dev": true, "requires": { "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", "has": "^1.0.3", "has-symbols": "^1.0.1", - "is-callable": "^1.2.0", - "is-regex": "^1.1.0", - "object-inspect": "^1.7.0", + "is-callable": "^1.2.2", + "is-regex": "^1.1.1", + "object-inspect": "^1.8.0", "object-keys": "^1.1.1", - "object.assign": "^4.1.0", + "object.assign": "^4.1.1", "string.prototype.trimend": "^1.0.1", "string.prototype.trimstart": "^1.0.1" } @@ -3785,9 +3785,9 @@ } }, "babel-preset-current-node-syntax": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-0.1.3.tgz", - "integrity": "sha512-uyexu1sVwcdFnyq9o8UQYsXwXflIh8LvrF5+cKrYam93ned1CStffB3+BEcsxGSgagoA3GEyjDqO4a/58hyPYQ==", + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-0.1.4.tgz", + "integrity": "sha512-5/INNCYhUGqw7VbVjT/hb3ucjgkVHKXY7lX3ZjlN4gm565VyFmJUrJ/h+h16ECVB38R/9SF6aACydpKMLZ/c9w==", "dev": true, "requires": { "@babel/plugin-syntax-async-generators": "^7.8.4", @@ -3951,9 +3951,9 @@ } }, "bignumber.js": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.0.tgz", - "integrity": "sha512-t/OYhhJ2SD+YGBQcjY8GzzDHEk9f3nerxjtfa6tlMXfe7frs/WozhvCNoGvpM0P3bNf3Gq5ZRMlGr5f3r4/N8A==" + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.1.tgz", + "integrity": "sha512-IdZR9mh6ahOBv/hYGiXyVuyCetmGJhtYkqLBpTStdhEGjegpPlUawydyaF3pbIOFynJTpllEs+NP+CS9jKFLjA==" }, "binary-extensions": { "version": "1.13.1", @@ -4327,13 +4327,13 @@ } }, "browserslist": { - "version": "4.14.3", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.14.3.tgz", - "integrity": "sha512-GcZPC5+YqyPO4SFnz48/B0YaCwS47Q9iPChRGi6t7HhflKBcINzFrJvRfC+jp30sRMKxF+d4EHGs27Z0XP1NaQ==", + "version": "4.14.5", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.14.5.tgz", + "integrity": "sha512-Z+vsCZIvCBvqLoYkBFTwEYH3v5MCQbsAjp50ERycpOjnPmolg1Gjy4+KaWWpm8QOJt9GHkhdqAl14NpCX73CWA==", "dev": true, "requires": { - "caniuse-lite": "^1.0.30001131", - "electron-to-chromium": "^1.3.570", + "caniuse-lite": "^1.0.30001135", + "electron-to-chromium": "^1.3.571", "escalade": "^3.1.0", "node-releases": "^1.1.61" } @@ -4675,9 +4675,9 @@ } }, "caniuse-lite": { - "version": "1.0.30001133", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001133.tgz", - "integrity": "sha512-s3XAUFaC/ntDb1O3lcw9K8MPeOW7KO3z9+GzAoBxfz1B0VdacXPMKgFUtG4KIsgmnbexmi013s9miVu4h+qMHw==", + "version": "1.0.30001143", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001143.tgz", + "integrity": "sha512-p/PO5YbwmCpBJPxjOiKBvAlUPgF8dExhfEpnsH+ys4N/791WHrYrGg0cyHiAURl5hSbx5vIcjKmQAP6sHDYH3w==", "dev": true }, "capture-exit": { @@ -5653,9 +5653,9 @@ } }, "css-what": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/css-what/-/css-what-3.3.0.tgz", - "integrity": "sha512-pv9JPyatiPaQ6pf4OvD/dbfm0o5LviWmwxNWzblYf/1u9QZd0ihV+PMwy5jdQWQ3349kZmKEx9WXuSka2dM4cg==", + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-3.4.1.tgz", + "integrity": "sha512-wHOppVDKl4vTAOWzJt5Ek37Sgd9qq1Bmj/T1OjvicWbU5W7ru7Pqbn0Jdqii3Drx/h+dixHKXNhZYx7blthL7g==", "dev": true }, "cssesc": { @@ -5899,9 +5899,9 @@ } }, "decimal.js": { - "version": "10.2.0", - "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.2.0.tgz", - "integrity": "sha512-vDPw+rDgn3bZe1+F/pyEwb1oMG2XTlRVgAa6B4KccTEpYgF8w6eQllVbQcfIJnZyvzFtFpxnpGtx8dd7DJp/Rw==", + "version": "10.2.1", + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.2.1.tgz", + "integrity": "sha512-KaL7+6Fw6i5A2XSnsbhm/6B+NuEA7TZ4vqxnd5tXz9sbKtrN9Srj8ab4vKVdK8YAqZO9P1kg45Y6YLoduPf+kw==", "dev": true }, "decode-uri-component": { @@ -6593,9 +6593,9 @@ } }, "electron-to-chromium": { - "version": "1.3.570", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.570.tgz", - "integrity": "sha512-Y6OCoVQgFQBP5py6A/06+yWxUZHDlNr/gNDGatjH8AZqXl8X0tE4LfjLJsXGz/JmWJz8a6K7bR1k+QzZ+k//fg==", + "version": "1.3.576", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.576.tgz", + "integrity": "sha512-uSEI0XZ//5ic+0NdOqlxp0liCD44ck20OAGyLMSymIWTEAtHKVJi6JM18acOnRgUgX7Q65QqnI+sNncNvIy8ew==", "dev": true }, "electron-updater": { @@ -6693,21 +6693,21 @@ } }, "es-abstract": { - "version": "1.18.0-next.0", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.0.tgz", - "integrity": "sha512-elZXTZXKn51hUBdJjSZGYRujuzilgXo8vSPQzjGYXLvSlGiCo8VO8ZGV3kjo9a0WNJJ57hENagwbtlRuHuzkcQ==", + "version": "1.18.0-next.1", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.1.tgz", + "integrity": "sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA==", "dev": true, "requires": { "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", "has": "^1.0.3", "has-symbols": "^1.0.1", - "is-callable": "^1.2.0", + "is-callable": "^1.2.2", "is-negative-zero": "^2.0.0", "is-regex": "^1.1.1", "object-inspect": "^1.8.0", "object-keys": "^1.1.1", - "object.assign": "^4.1.0", + "object.assign": "^4.1.1", "string.prototype.trimend": "^1.0.1", "string.prototype.trimstart": "^1.0.1" }, @@ -13559,20 +13559,20 @@ }, "dependencies": { "es-abstract": { - "version": "1.17.6", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz", - "integrity": "sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw==", + "version": "1.17.7", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", + "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", "dev": true, "requires": { "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", "has": "^1.0.3", "has-symbols": "^1.0.1", - "is-callable": "^1.2.0", - "is-regex": "^1.1.0", - "object-inspect": "^1.7.0", + "is-callable": "^1.2.2", + "is-regex": "^1.1.1", + "object-inspect": "^1.8.0", "object-keys": "^1.1.1", - "object.assign": "^4.1.0", + "object.assign": "^4.1.1", "string.prototype.trimend": "^1.0.1", "string.prototype.trimstart": "^1.0.1" } @@ -13598,20 +13598,20 @@ }, "dependencies": { "es-abstract": { - "version": "1.17.6", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz", - "integrity": "sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw==", + "version": "1.17.7", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", + "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", "dev": true, "requires": { "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", "has": "^1.0.3", "has-symbols": "^1.0.1", - "is-callable": "^1.2.0", - "is-regex": "^1.1.0", - "object-inspect": "^1.7.0", + "is-callable": "^1.2.2", + "is-regex": "^1.1.1", + "object-inspect": "^1.8.0", "object-keys": "^1.1.1", - "object.assign": "^4.1.0", + "object.assign": "^4.1.1", "string.prototype.trimend": "^1.0.1", "string.prototype.trimstart": "^1.0.1" } @@ -13635,20 +13635,20 @@ }, "dependencies": { "es-abstract": { - "version": "1.17.6", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz", - "integrity": "sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw==", + "version": "1.17.7", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", + "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", "dev": true, "requires": { "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", "has": "^1.0.3", "has-symbols": "^1.0.1", - "is-callable": "^1.2.0", - "is-regex": "^1.1.0", - "object-inspect": "^1.7.0", + "is-callable": "^1.2.2", + "is-regex": "^1.1.1", + "object-inspect": "^1.8.0", "object-keys": "^1.1.1", - "object.assign": "^4.1.0", + "object.assign": "^4.1.1", "string.prototype.trimend": "^1.0.1", "string.prototype.trimstart": "^1.0.1" } @@ -13683,20 +13683,20 @@ }, "dependencies": { "es-abstract": { - "version": "1.17.6", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz", - "integrity": "sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw==", + "version": "1.17.7", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", + "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", "dev": true, "requires": { "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", "has": "^1.0.3", "has-symbols": "^1.0.1", - "is-callable": "^1.2.0", - "is-regex": "^1.1.0", - "object-inspect": "^1.7.0", + "is-callable": "^1.2.2", + "is-regex": "^1.1.1", + "object-inspect": "^1.8.0", "object-keys": "^1.1.1", - "object.assign": "^4.1.0", + "object.assign": "^4.1.1", "string.prototype.trimend": "^1.0.1", "string.prototype.trimstart": "^1.0.1" } @@ -14508,9 +14508,9 @@ "dev": true }, "postcss": { - "version": "7.0.34", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.34.tgz", - "integrity": "sha512-H/7V2VeNScX9KE83GDrDZNiGT1m2H+UTnlinIzhjlLX9hfMUn1mHNnGeX81a1c8JSBdBvqk7c2ZOG6ZPn5itGw==", + "version": "7.0.35", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.35.tgz", + "integrity": "sha512-3QT8bBJeX/S5zKTTjTCIjRF3If4avAT6kqxcASlTWEtAFCb9NH0OUxNDfgZSWdP5fJnBYCMEWkIFfWeugjzYMg==", "dev": true, "requires": { "chalk": "^2.4.2", @@ -14530,9 +14530,9 @@ } }, "postcss-calc": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/postcss-calc/-/postcss-calc-7.0.4.tgz", - "integrity": "sha512-0I79VRAd1UTkaHzY9w83P39YGO/M3bG7/tNLrHGEunBolfoGM0hSjrGvjoeaj0JE/zIw5GsI2KZ0UwDJqv5hjw==", + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/postcss-calc/-/postcss-calc-7.0.5.tgz", + "integrity": "sha512-1tKHutbGtLtEZF6PT4JSihCHfIVldU72mZ8SdZHIYriIZ9fh9k9aWSppaT8rHsyI3dX+KSR+W+Ix9BMY3AODrg==", "dev": true, "requires": { "postcss": "^7.0.27", @@ -14971,9 +14971,9 @@ } }, "postcss-selector-parser": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.3.tgz", - "integrity": "sha512-0ClFaY4X1ra21LRqbW6y3rUbWcxnSVkDFG57R7Nxus9J9myPFlv+jYDMohzpkBx0RrjjiqjtycpchQ+PLGmZ9w==", + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.4.tgz", + "integrity": "sha512-gjMeXBempyInaBqpp8gODmwZ52WaYsVOsfr4L4lDQ7n3ncD6mEyySiDtgzCT+NYC0mmeOLvtsF8iaEf0YT6dBw==", "dev": true, "requires": { "cssesc": "^3.0.0", @@ -16916,20 +16916,20 @@ }, "dependencies": { "es-abstract": { - "version": "1.17.6", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz", - "integrity": "sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw==", + "version": "1.17.7", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", + "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", "dev": true, "requires": { "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", "has": "^1.0.3", "has-symbols": "^1.0.1", - "is-callable": "^1.2.0", - "is-regex": "^1.1.0", - "object-inspect": "^1.7.0", + "is-callable": "^1.2.2", + "is-regex": "^1.1.1", + "object-inspect": "^1.8.0", "object-keys": "^1.1.1", - "object.assign": "^4.1.0", + "object.assign": "^4.1.1", "string.prototype.trimend": "^1.0.1", "string.prototype.trimstart": "^1.0.1" } @@ -16953,20 +16953,20 @@ }, "dependencies": { "es-abstract": { - "version": "1.17.6", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz", - "integrity": "sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw==", + "version": "1.17.7", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", + "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", "dev": true, "requires": { "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", "has": "^1.0.3", "has-symbols": "^1.0.1", - "is-callable": "^1.2.0", - "is-regex": "^1.1.0", - "object-inspect": "^1.7.0", + "is-callable": "^1.2.2", + "is-regex": "^1.1.1", + "object-inspect": "^1.8.0", "object-keys": "^1.1.1", - "object.assign": "^4.1.0", + "object.assign": "^4.1.1", "string.prototype.trimend": "^1.0.1", "string.prototype.trimstart": "^1.0.1" } @@ -18176,9 +18176,9 @@ "dev": true }, "update-notifier": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-4.1.1.tgz", - "integrity": "sha512-9y+Kds0+LoLG6yN802wVXoIfxYEwh3FlZwzMwpCZp62S2i1/Jzeqb9Eeeju3NSHccGGasfGlK5/vEHbAifYRDg==", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-4.1.3.tgz", + "integrity": "sha512-Yld6Z0RyCYGB6ckIjffGOSOmHXj1gMeE7aROz4MG+XMkmixBX4jUngrGXNYz7wPKBmtoD4MnBa2Anu7RSKht/A==", "dev": true, "requires": { "boxen": "^4.2.0", @@ -18382,20 +18382,20 @@ }, "dependencies": { "es-abstract": { - "version": "1.17.6", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz", - "integrity": "sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw==", + "version": "1.17.7", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", + "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", "dev": true, "requires": { "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", "has": "^1.0.3", "has-symbols": "^1.0.1", - "is-callable": "^1.2.0", - "is-regex": "^1.1.0", - "object-inspect": "^1.7.0", + "is-callable": "^1.2.2", + "is-regex": "^1.1.1", + "object-inspect": "^1.8.0", "object-keys": "^1.1.1", - "object.assign": "^4.1.0", + "object.assign": "^4.1.1", "string.prototype.trimend": "^1.0.1", "string.prototype.trimstart": "^1.0.1" } @@ -18453,9 +18453,9 @@ } }, "varint": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/varint/-/varint-5.0.0.tgz", - "integrity": "sha1-2Ca4n3SQcy+rwMDtaT7Uddyynr8=" + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/varint/-/varint-5.0.2.tgz", + "integrity": "sha512-lKxKYG6H03yCZUpAGOPOsMcGxd1RHCu1iKvEHYDPmTyq2HueGhD73ssNBqqQWfvYs04G9iUFRvmAVLW20Jw6ow==" }, "vary": { "version": "1.1.2", @@ -19733,9 +19733,9 @@ "dev": true }, "whatwg-url": { - "version": "8.2.2", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-8.2.2.tgz", - "integrity": "sha512-PcVnO6NiewhkmzV0qn7A+UZ9Xx4maNTI+O+TShmfE4pqjoCMwUMjkvoNhNHPTvgR7QH9Xt3R13iHuWy2sToFxQ==", + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-8.3.0.tgz", + "integrity": "sha512-BQRf/ej5Rp3+n7k0grQXZj9a1cHtsp4lqj01p59xBWFKdezR8sO37XnpafwNqiFac/v2Il12EIMjX/Y4VZtT8Q==", "dev": true, "requires": { "lodash.sortby": "^4.7.0", From 1b4a8a53019f5e0ca40037d4d4edc35b2873cdae Mon Sep 17 00:00:00 2001 From: Jordan Muir Date: Fri, 9 Oct 2020 02:15:39 -0400 Subject: [PATCH 03/24] Network phase change (#366) * Custom networks * State refactor for network flexibility --- app/App/Components/Dropdown/index.styl | 17 +- app/App/Panel/Client/index.js | 2 +- app/App/Panel/Local/index.js | 162 +-- app/App/Panel/Local/style/index.styl | 15 +- app/App/Panel/Main/Add/AddAragon/index.js | 5 +- app/App/Panel/Main/Add/AddPhrase/index.js | 2 +- app/App/Panel/Main/Add/AddRing/index.js | 4 +- .../Requests/TransactionRequest/index.js | 30 +- .../Main/Signer/Requests/style/index.styl | 2 +- app/App/Panel/Main/Signer/style/index.styl | 51 +- app/App/Panel/Main/index.js | 5 +- app/App/Panel/Notify/index.js | 167 --- app/App/Panel/Notify/style/index.styl | 137 -- app/App/Panel/Phase/AddAragon/index.js | 220 +++ app/App/Panel/Phase/AddHardware/index.js | 74 ++ app/App/Panel/Phase/AddPhrase/index.js | 155 +++ app/App/Panel/Phase/AddRing/index.js | 245 ++++ app/App/Panel/Phase/Networks/index.js | 212 +++ app/App/Panel/Phase/Networks/style/index.styl | 150 +++ app/App/Panel/Phase/index.js | 85 ++ app/App/Panel/Phase/particleWorker.js | 47 + app/App/Panel/Phase/style/index.styl | 696 ++++++++++ app/App/Panel/index.js | 12 +- app/App/Panel/style/index.styl | 1 + app/index.styl | 11 +- app/store/actions/index.js | 2 + app/svg/index.js | 18 + main/accounts/Account/index.js | 2 +- main/accounts/aragon/index.js | 9 +- main/accounts/index.js | 4 +- main/api/ws.js | 8 +- main/clients/Geth/index.js | 2 +- main/clients/Parity/index.js | 2 +- main/clients/index.js | 12 +- main/index.js | 11 +- main/nodes/index.js | 152 ++- main/provider/index.js | 28 +- main/rpc/index.js | 14 +- main/signers/hot/HotSigner/index.js | 10 +- main/signers/ledger-ble/LedgerBLE/index.js | 4 +- main/signers/ledger/Ledger/index.js | 6 +- main/signers/trezor-connect/Trezor/index.js | 6 +- main/store/actions/index.js | 167 ++- main/store/state/index.js | 253 +++- package-lock.json | 1179 +++++++++-------- package.json | 22 +- 46 files changed, 3194 insertions(+), 1224 deletions(-) create mode 100644 app/App/Panel/Phase/AddAragon/index.js create mode 100644 app/App/Panel/Phase/AddHardware/index.js create mode 100644 app/App/Panel/Phase/AddPhrase/index.js create mode 100644 app/App/Panel/Phase/AddRing/index.js create mode 100644 app/App/Panel/Phase/Networks/index.js create mode 100644 app/App/Panel/Phase/Networks/style/index.styl create mode 100644 app/App/Panel/Phase/index.js create mode 100644 app/App/Panel/Phase/particleWorker.js create mode 100644 app/App/Panel/Phase/style/index.styl diff --git a/app/App/Components/Dropdown/index.styl b/app/App/Components/Dropdown/index.styl index 4391c613e..9cbf4e3a2 100644 --- a/app/App/Components/Dropdown/index.styl +++ b/app/App/Components/Dropdown/index.styl @@ -3,14 +3,14 @@ display flex align-items flex-start height 26px - z-index 9999999 + z-index 99999999999999 .dropdown border-radius 13px letter-spacing 1px height 26px font-weight 400 - width 113px + width 125px font-size 13px text-transform uppercase background highlight @@ -30,11 +30,18 @@ .dropdownItem display flex - justify-content center align-items center height 26px min-height 26px - width 100% + width calc(100% - 20px) box-sizing border-box - padding 0px 15px 0px 15px transform translateZ(0) + margin 0px 10px 0px 10px + overflow hidden + position relative + z-index 99999999999999 + + &::before, &::after + pointer-events: none + content: '' + flex: 1 diff --git a/app/App/Panel/Client/index.js b/app/App/Panel/Client/index.js index ed960180d..948e25dd2 100644 --- a/app/App/Panel/Client/index.js +++ b/app/App/Panel/Client/index.js @@ -7,7 +7,7 @@ import Status from './Status' class Client extends React.Component { toggle = () => { const client = this.props.client - const networkId = this.store('main.connection.network') + const networkId = this.store('main.currentNetwork.id') const on = this.store(`main.clients.${client}.on`) const state = this.store(`main.clients.${client}.state`) diff --git a/app/App/Panel/Local/index.js b/app/App/Panel/Local/index.js index f57ba4e67..95ddab6aa 100644 --- a/app/App/Panel/Local/index.js +++ b/app/App/Panel/Local/index.js @@ -10,15 +10,18 @@ class Settings extends React.Component { constructor (props, context) { super(props, context) this.customMessage = 'Custom Endpoint' - this.network = context.store('main.connection.network') - const primaryCustom = context.store('main.connection.local.settings', this.network, 'options.custom') || this.customMessage - const secondaryCustom = context.store('main.connection.secondary.settings', this.network, 'options.custom') || this.customMessage + this.network = context.store('main.currentNetwork.id') + this.networkType = context.store('main.currentNetwork.type') + const primaryCustom = context.store('main.networks', this.networkType, this.network, 'primary.custom') || this.customMessage + const secondaryCustom = context.store('main.networks', this.networkType, this.network, 'secondary.custom') || this.customMessage this.state = { localShake: {}, primaryCustom, secondaryCustom, resetConfirm: false, expandNetwork: false } context.store.observer(() => { - if (this.network !== context.store('main.connection.network')) { - this.network = context.store('main.connection.network') - const primaryCustom = context.store('main.connection.local.settings', this.network, 'options.custom') || this.customMessage - const secondaryCustom = context.store('main.connection.secondary.settings', this.network, 'options.custom') || this.customMessage + const { type, id } = context.store('main.currentNetwork') + if (this.network !== id || this.networkType !== type) { + this.networkType = type + this.network = id + const primaryCustom = context.store('main.networks', type, id , 'primary.custom') || this.customMessage + const secondaryCustom = context.store('main.networks', type, id, 'secondary.custom') || this.customMessage this.setState({ primaryCustom, secondaryCustom }) } }) @@ -69,7 +72,7 @@ class Settings extends React.Component { inputPrimaryCustom (e) { e.preventDefault() clearTimeout(this.customPrimaryInputTimeout) - const value = e.target.value + const value = e.target.value.replace(/\s+/g, '') this.setState({ primaryCustom: value }) this.customPrimaryInputTimeout = setTimeout(() => link.send('tray:action', 'setPrimaryCustom', this.state.primaryCustom), 1000) } @@ -77,7 +80,7 @@ class Settings extends React.Component { inputSecondaryCustom (e) { e.preventDefault() clearTimeout(this.customSecondaryInputTimeout) - const value = e.target.value + const value = e.target.value.replace(/\s+/g, '') this.setState({ secondaryCustom: value }) this.customSecondaryInputTimeout = setTimeout(() => link.send('tray:action', 'setSecondaryCustom', this.state.secondaryCustom), 1000) } @@ -94,13 +97,13 @@ class Settings extends React.Component { } status (layer) { - const connection = this.store('main.connection', layer) // primary is 'local' and secondary is 'secondary' + const { type, id } = this.store('main.currentNetwork') + const connection = this.store('main.networks', type, id, 'connection', layer) let status = connection.status - const network = this.store('main.connection.network') - const current = connection.settings[network].current + const current = connection.current if (current === 'custom' ) { - if (layer === 'local' && this.state.primaryCustom !== '' && this.state.primaryCustom !== this.customMessage && !this.okProtocol(this.state.primaryCustom)) status = 'invalid target' + if (layer === 'primary' && this.state.primaryCustom !== '' && this.state.primaryCustom !== this.customMessage && !this.okProtocol(this.state.primaryCustom)) status = 'invalid target' if (layer === 'secondary' && this.state.secondaryCustom !== '' && this.state.secondaryCustom !== this.customMessage && !this.okProtocol(this.state.secondaryCustom)) status = 'invalid target' } if (status === 'connected' && !connection.network) status = 'loading' @@ -131,9 +134,8 @@ class Settings extends React.Component { } selectNetwork (network) { - if (network !== this.store('main.connection.network')) { - link.send('tray:action', 'selectNetwork', network) - } + const [type, id] = network.split(':') + if (network.type !== type || network.id !== id) link.send('tray:action', 'selectNetwork', type, id) } expandNetwork (e, expand) { @@ -142,85 +144,65 @@ class Settings extends React.Component { } render () { - let primaryOptions = this.store('main.connection.local.settings', this.store('main.connection.network'), 'options') - let secondaryOptions = this.store('main.connection.secondary.settings', this.store('main.connection.network'), 'options') - - primaryOptions = Object.keys(primaryOptions).map(i => ({ text: i, value: i })) - secondaryOptions = Object.keys(secondaryOptions).map(i => ({ text: i, value: i })) - - let networks = this.store('main.networks') - let networkOptions = Object.keys(networks).map(i => ({ text: networks[i].name, value: i })) - + const { type, id } = this.store('main.currentNetwork') + const networks = this.store('main.networks') + const connection = networks[type][id].connection + const networkPresets = this.store('main.networkPresets', type) + let presets = networkPresets[id] + presets = Object.keys(presets).map(i => ({ text: i, value: type + ':' + id + ':' + i })) + presets = presets.concat(Object.keys(networkPresets.default).map(i => ({ text: i, value: type + ':' + id + ':' + i }))) + presets.push({ text: 'Custom', value: type + ':' + id + ':' + 'custom'}) + const networkOptions = [] + Object.keys(networks).map(type => { + Object.keys(networks[type]).map(id => { + networkOptions.push({ text: networks[type][id].name, value: type + ':' + id }) + }) + }) return (
this.expandNetwork(e, false)}>
-
-
Connection
-
this.store.notify('editNetworks')}>{svg.broadcast(16)}
+
+
Connection
+
this.store.toggleAddNetwork()}>{svg.broadcast(16)}
this.selectNetwork(network)} options={networkOptions} />
- {/*
-
-
-
Local
-
link.send('tray:action', 'toggleConnection', 'local')}> -
-
-
-
-
- {this.status(this.store('main.connection.local'))} -
-
this.localShake('custom')}> -
- {this.store('main.connection.local.type') ? ( -
{this.store('main.connection.local.type')}
- ) : (_ => { - const status = this.store('main.connection.local.status') - if (status === 'not found' || status === 'loading' || status === 'disconnected') return
scanning...
- return '' - })()} -
-
-
-
-
-
-
*/}
-
+
Primary
-
link.send('tray:action', 'toggleConnection', 'local')}> +
link.send('tray:action', 'toggleConnection', type, id, 'primary')}>
- {this.status('local')} + {this.status('primary')} link.send('tray:action', 'selectPrimary', value)} - options={primaryOptions} + syncValue={type + ':' + id + ':' + connection.primary.current} + onChange={preset => { + const [type, id, value] = preset.split(':') + link.send('tray:action', 'selectPrimary', type, id, value) + }} + options={presets} />
-
+
this.customPrimaryFocus()} onBlur={() => this.customPrimaryBlur()} onChange={e => this.inputPrimaryCustom(e)} />
-
+
Secondary
-
link.send('tray:action', 'toggleConnection', 'secondary')}> +
link.send('tray:action', 'toggleConnection', type, id, 'secondary')}>
@@ -228,20 +210,23 @@ class Settings extends React.Component {
{this.status('secondary')} link.send('tray:action', 'selectSecondary', value)} - options={secondaryOptions} + syncValue={type + ':' + id + ':' + connection.secondary.current} + onChange={preset => { + const [type, id, value] = preset.split(':') + link.send('tray:action', 'selectSecondary', type, id, value) + }} + options={presets} />
- -
+
this.customSecondaryFocus()} onBlur={() => this.customSecondaryBlur()} onChange={e => this.inputSecondaryCustom(e)} />
- -
Settings
+
+
Settings
+
Run on Startup
@@ -266,7 +251,7 @@ class Settings extends React.Component {
-
Ledger Derivation Path
+
Ledger Path
link.send('tray:action', 'setLedgerDerivation', value)} @@ -301,3 +286,32 @@ export default Restore.connect(Settings) //
//
//
+ +{/*
+
+
+
Local
+
link.send('tray:action', 'toggleConnection', 'primary')}> +
+
+
+
+
+ {this.status(this.store('main..connection.local'))} +
+
this.localShake('custom')}> +
+ {this.store('main..connection.local.type') ? ( +
{this.store('main..connection.local.type')}
+ ) : (_ => { + const status = this.store('main..connection.local.status') + if (status === 'not found' || status === 'loading' || status === 'disconnected') return
scanning...
+ return '' + })()} +
+
+
+
+
+
+
*/} diff --git a/app/App/Panel/Local/style/index.styl b/app/App/Panel/Local/style/index.styl index 251743268..cd1f76980 100644 --- a/app/App/Panel/Local/style/index.styl +++ b/app/App/Panel/Local/style/index.styl @@ -10,16 +10,15 @@ transition standard transform translateZ(0) - .localSettingsAddChain + .localSettingsAddNetwork position absolute - right 130px + right 145px display flex justify-content center align-items center height 26px z-index 9999999 border-radius 13px - // letter-spacing 1px height 26px font-weight 200 width 26px @@ -27,7 +26,7 @@ text-transform uppercase background highlight overflow hidden - box-shadow cardDrop, 0px 2px 1px thick + box-shadow cardDrop, 0px 2px 1px thin padding 0px 0px 0px 0px transition standard transform translateZ(0) @@ -75,13 +74,15 @@ position relative display flex align-items flex-start - z-index 9999999 height 26px - font-size 22px + font-size 25px font-weight 200 padding 0px 10px 15px 10px margin 50px 0px 0px 0px + .localSettingsTitleText + margin-top -5px + .localSettingsHidden right -100% left 100% @@ -162,7 +163,7 @@ border-radius 3px margin 0px -15px -15px -15px padding 0px 15px 15px 15px - // overflow hidden + overflow hidden transform translateZ(0) .connectionOptionToggle diff --git a/app/App/Panel/Main/Add/AddAragon/index.js b/app/App/Panel/Main/Add/AddAragon/index.js index e62cee4f7..4210b3c74 100644 --- a/app/App/Panel/Main/Add/AddAragon/index.js +++ b/app/App/Panel/Main/Add/AddAragon/index.js @@ -121,7 +121,8 @@ class AddAragon extends React.Component { } accountFilter (id) { - const network = this.store('main.connection.network') + // Need to migrate accounts to use network type + const network = this.store('main.currentNetwork.id') const account = this.store('main.accounts', id) if (account.type === 'aragon') return false return account.network === network @@ -202,7 +203,7 @@ class AddAragon extends React.Component {
{ - const net = this.store('main.connection.network') + const net = this.store('main.currentNetwork.id') const open = url => this.store.notify('openExternal', { url }) if (net === '1') return open('https://mainnet.aragon.org') if (net === '4') return open('https://rinkeby.aragon.org') diff --git a/app/App/Panel/Main/Add/AddPhrase/index.js b/app/App/Panel/Main/Add/AddPhrase/index.js index eb46a01e9..986d93139 100644 --- a/app/App/Panel/Main/Add/AddPhrase/index.js +++ b/app/App/Panel/Main/Add/AddPhrase/index.js @@ -116,7 +116,7 @@ class AddPhrase extends React.Component {
{ this.adding() - if (this.store('main.connection.network') === '1') setTimeout(() => this.store.notify('hotAccountWarning'), 800) + if (this.store('main.currentNetwork.id') === '1') setTimeout(() => this.store.notify('hotAccountWarning'), 800) }} > {'Add Phrase Account'} diff --git a/app/App/Panel/Main/Add/AddRing/index.js b/app/App/Panel/Main/Add/AddRing/index.js index 001b02550..65bf7cc42 100644 --- a/app/App/Panel/Main/Add/AddRing/index.js +++ b/app/App/Panel/Main/Add/AddRing/index.js @@ -153,6 +153,8 @@ class AddRing extends React.Component { render () { let itemClass = 'addAccountItem addAccountItemSmart' if (this.state.adding) itemClass += ' addAccountItemAdding' + const { type, id } = this.store('main.currentNetwork') + const network = type + ':' + id return (
@@ -170,7 +172,7 @@ class AddRing extends React.Component {
{ this.adding() - if (this.store('main.connection.network') === '1') setTimeout(() => this.store.notify('hotAccountWarning'), 800) + if (network === 'ethereum:1') setTimeout(() => this.store.notify('hotAccountWarning'), 800) }} > {'Add Keyring Account'} diff --git a/app/App/Panel/Main/Signer/Requests/TransactionRequest/index.js b/app/App/Panel/Main/Signer/Requests/TransactionRequest/index.js index aa1b8db1e..57fcd1b85 100644 --- a/app/App/Panel/Main/Signer/Requests/TransactionRequest/index.js +++ b/app/App/Panel/Main/Signer/Requests/TransactionRequest/index.js @@ -41,10 +41,12 @@ class TransactionRequest extends React.Component { return (Math.round(parseFloat(utils.fromWei(hex, 'ether')) * 1000000) / 1000000).toFixed(6) } - setGasPrice (price, level) { - const chain = this.store('main.connection.network') - const feeLevel = this.store('main.gasPrice', chain, 'default') - if (price && (price !== this.props.req.data.gasPrice || level !== feeLevel)) link.rpc('setGasPrice', price, level, this.props.req.handlerId, e => console.log(e)) + setGasPrice (netType, netId, price, level) { + const network = this.store('main.currentNetwork') + const feeLevel = this.store('main.networks', network.type, network.id, 'gas.price.selected') + if (price && (price !== this.props.req.data.gasPrice || level !== feeLevel)) link.rpc('setGasPrice', netType, netId, price, level, this.props.req.handlerId, e => { + if (e) console.log(e) + }) this.setState({ selectedIndex: -1 }) } @@ -103,8 +105,8 @@ class TransactionRequest extends React.Component { } hoverBar (hoverGasPercent) { - const trader = this.store('main.gasPrice', this.store('main.connection.network'),'levels.trader') - // const safelow = this.store('main.gasPrice.levels.safelow') + const network = this.store('main.currentNetwork') + const trader = this.store('main.networks', network.type, network.id, 'gas.price.levels.trader') const top = parseInt(trader, 16) * 4 const bottom = 1 // parseInt(safelow, 16) / 10 const percentBuffer = Math.round((bottom / top) * 100) / 100 @@ -146,9 +148,9 @@ class TransactionRequest extends React.Component { renderFee () { const expanded = this.state.selectedIndex === 0 const { data, mode } = this.props.req - const chain = this.store('main.connection.network') - let feeLevel = this.store('main.gasPrice', chain, 'default') - const gasLevels = this.store('main.gasPrice', chain, 'levels') + const network = this.store('main.currentNetwork') + let feeLevel = this.store('main.networks', network.type, network.id, 'gas.price.selected') + const gasLevels = this.store('main.networks', network.type, network.id, 'gas.price.levels') if (gasLevels[feeLevel] !== data.gasPrice) feeLevel = 'custom' const etherRates = this.store('external.rates') const etherUSD = etherRates && etherRates.USD ? parseFloat(etherRates.USD) : 0 @@ -196,7 +198,7 @@ class TransactionRequest extends React.Component {
Fee
this.setGasPrice(gasLevels.safelow, 'safelow') : null} + onMouseDown={expanded ? () => this.setGasPrice(network.type, network.id, gasLevels.safelow, 'safelow') : null} onMouseEnter={expanded ? () => this.setState({ hoverGwei: parseInt(gasLevels.safelow, 'hex') / 1000000000 }) : null} onMouseLeave={expanded ? () => this.setState({ hoverGwei: 0 }) : null} > @@ -210,7 +212,7 @@ class TransactionRequest extends React.Component {
this.setGasPrice(gasLevels.standard, 'standard') : null} + onMouseDown={expanded ? () => this.setGasPrice(network.type, network.id, gasLevels.standard, 'standard') : null} onMouseEnter={expanded ? () => this.setState({ hoverGwei: parseInt(gasLevels.standard, 'hex') / 1000000000 }) : null} onMouseLeave={expanded ? () => this.setState({ hoverGwei: 0 }) : null} > @@ -224,7 +226,7 @@ class TransactionRequest extends React.Component {
this.setGasPrice(gasLevels.fast, 'fast') : null} + onMouseDown={expanded ? () => this.setGasPrice(network.type, network.id, gasLevels.fast, 'fast') : null} onMouseEnter={expanded ? () => this.setState({ hoverGwei: parseInt(gasLevels.fast, 'hex') / 1000000000 }) : null} onMouseLeave={expanded ? () => this.setState({ hoverGwei: 0 }) : null} > @@ -238,7 +240,7 @@ class TransactionRequest extends React.Component {
this.setGasPrice(gasLevels.trader, 'trader') : null} + onMouseDown={expanded ? () => this.setGasPrice(network.type, network.id, gasLevels.trader, 'trader') : null} onMouseEnter={expanded ? () => this.setState({ hoverGwei: parseInt(gasLevels.trader, 'hex') / 1000000000 }) : null} onMouseLeave={expanded ? () => this.setState({ hoverGwei: 0 }) : null} > @@ -253,7 +255,7 @@ class TransactionRequest extends React.Component {
{ this.setGasPrice(this.state.hoverGasPrice, 'custom') } : null} + onMouseDown={expanded ? () => { this.setGasPrice(network.type, network.id, this.state.hoverGasPrice, 'custom') } : null} onMouseEnter={expanded ? e => this.handleCustomPriceHover(e, true) : null} onMouseMove={expanded ? e => this.handleCustomPriceHover(e) : null} onMouseLeave={expanded ? e => this.handleCustomPriceHoverReset() : null} diff --git a/app/App/Panel/Main/Signer/Requests/style/index.styl b/app/App/Panel/Main/Signer/Requests/style/index.styl index a96c85655..9a5b62342 100644 --- a/app/App/Panel/Main/Signer/Requests/style/index.styl +++ b/app/App/Panel/Main/Signer/Requests/style/index.styl @@ -284,7 +284,7 @@ bottom 0 left 0 z-index 200 - padding 0px 0px 30px 0px + padding 0px 0px 64px 0px transition standardSlow overflow-y scroll overflow-x hidden diff --git a/app/App/Panel/Main/Signer/style/index.styl b/app/App/Panel/Main/Signer/style/index.styl index 23566b063..3c5eb7442 100644 --- a/app/App/Panel/Main/Signer/style/index.styl +++ b/app/App/Panel/Main/Signer/style/index.styl @@ -65,13 +65,13 @@ bottom 3px background lowlight z-index 40 - border-radius 3px + border-radius 16px z-index 3003 .signerContainer position relative z-index 3002 - border-radius 3px + border-radius 16px box-shadow 0px 0px 4px -1px rgba(6, 54, 52, 0.05), 0px 1px 1px 0px rgba(6, 54, 122, 0.1), 0 0px 100px -50px rgba(6, 24, 52, .4), cardDrop background lightShade padding-bottom 3px @@ -143,10 +143,7 @@ position relative opacity 1 z-index 3030 - border-top-left-radius 3px - border-top-right-radius 3px - border-bottom-left-radius 9px - border-bottom-right-radius 9px + border-radius 16px box-shadow 0px 2px 3px thin, 0px 19px 9px -14px thin !important background highlight transition standard @@ -180,8 +177,8 @@ /// background linear-gradient(lowlight, lowlight) // background linear-gradient(lowlight, highlighter) // box-shadow 0px 2px 3px thin, 0px 19px 9px -14px thin !important - border-bottom-left-radius 6px - border-bottom-right-radius 6px + border-bottom-left-radius 16px + border-bottom-right-radius 16px transition standard -webkit-app-region no-drag @@ -265,10 +262,10 @@ margin-left -55px width 110px height 74px - border-bottom-left-radius 6px - border-bottom-right-radius 6px - border-top-left-radius 0px - border-top-right-radius 0px + border-radius 16px + // border-bottom-right-radius 6px + // border-top-left-radius 0px + // border-top-right-radius 0px display flex justify-content center align-items center @@ -281,7 +278,6 @@ transform translateZ(0) // box-shadow 0px -5px 5px 5px thick, 0px 2px 2px 1px highlighter - border-radius 6px display flex justify-content center align-items center @@ -372,7 +368,7 @@ right 0px bottom 2px background outerspaceDark - border-radius 6px + border-radius 16px display flex justify-content center align-items center @@ -390,10 +386,10 @@ right 0px bottom 2px background outerspace - border-top-left-radius 6px - border-top-right-radius 6px - border-bottom-left-radius 5px - border-bottom-right-radius 5px + border-radius 16px + // border-top-right-radius 6px + // border-bottom-left-radius 5px + // border-bottom-right-radius 5px .signerInnerActive top 0px @@ -824,7 +820,7 @@ bottom 3px left 0px padding-top 20px - border-radius 6px + border-radius 16px z-index 3005 overflow-x hidden overflow-y hidden @@ -887,19 +883,18 @@ .signerBot position absolute bottom 3px - left 0 - right 0 + left 3px + right 3px opacity 1 z-index 3060 - height 20px - border-top-left-radius 9px - border-top-right-radius 9px - border-bottom-left-radius 4px - border-bottom-right-radius 4px + height 64px + border-bottom-left-radius 16px + border-bottom-right-radius 16px + pointer-events none + transition standard transform translateZ(0) - background highlight - box-shadow 0px -2px 3px thin, 0px -19px 9px -14px thin !important + background linear-gradient(rgba(255, 255, 255, 0), highlight) overflow hidden .signerEvents diff --git a/app/App/Panel/Main/index.js b/app/App/Panel/Main/index.js index 2d9c8b975..fa89e0958 100644 --- a/app/App/Panel/Main/index.js +++ b/app/App/Panel/Main/index.js @@ -37,7 +37,8 @@ class Main extends React.Component { render () { const accounts = {} - const network = this.store('main.connection.network') + const network = this.store('main.currentNetwork.id') + const type = this.store('main.currentNetwork.type') Object.keys(this.store('main.accounts')).forEach(id => { const account = this.store('main.accounts', id) if (account.network === network) accounts[id] = account @@ -61,7 +62,7 @@ class Main extends React.Component { {Object.keys(accounts).length === 0 && Object.keys(signers).length === 0 ? (
{svg.logo(70)}
- {`No ${this.store('main.networks', network, 'name')} Accounts Found`} + {`No ${this.store('main.networks', type, network, 'name')} Accounts Found`} this.store.notify('intro')}>Need help getting started? diff --git a/app/App/Panel/Notify/index.js b/app/App/Panel/Notify/index.js index 8fa351917..f168ce8d7 100644 --- a/app/App/Panel/Notify/index.js +++ b/app/App/Panel/Notify/index.js @@ -3,73 +3,7 @@ import Restore from 'react-restore' import svg from '../../../svg' import link from '../../../link' -class Network extends React.Component { - constructor (...args) { - super(...args) - const { id, name, explorer } = this.props - this.state = { id, name, explorer } - } - render () { - const changed = ( - this.props.id !== this.state.id || - this.props.name !== this.state.name || - this.props.explorer !== this.state.explorer - ) - return ( -
- {changed ? ( -
{svg.save(16)}
- ):( -
{svg.octicon('x', { height: 16 })}
- )} -
- { - this.setState({ name: e.target.value }) - }} - onBlur={(e) => { - if (e.target.value === '') this.setState({ name: this.props.name }) - }} - /> -
-
- { - this.setState({ id: e.target.value }) - }} - onBlur={(e) => { - if (e.target.value === '') this.setState({ id: this.props.id }) - }} - /> -
-
- { - this.setState({ explorer: e.target.value }) - }} - onBlur={(e) => { - if (e.target.value === '') this.setState({ explorer: this.props.explorer }) - }} - /> -
-
- ) - } -} - class Notify extends React.Component { - constructor (...args) { - super(...args) - this.newNetworkIdDefault = 'ID' - this.newNetworkNameDefault = 'New Network' - this.newNetworkExplorerDefault = 'Block Explorer' - this.state = { - newNetworkId: this.newNetworkIdDefault, - newNetworkName: this.newNetworkNameDefault, - newNetworkExplorer: this.newNetworkExplorerDefault - } - } - intro () { return (
@@ -357,106 +291,6 @@ class Notify extends React.Component { ) } - renderNetworks () { - const networks = this.store('main.networks') - return Object.keys(networks).map(id => { - return - }) - } - - editNetworks () { - const changedNewNetwork = ( - this.state.newNetworkId !== this.newNetworkIdDefault || - this.state.newNetworkName !== this.newNetworkNameDefault || - this.state.newNetworkExplorer !== this.newNetworkExplorerDefault - ) - - const newNetworkReady = ( - this.state.newNetworkId !== this.newNetworkIdDefault && this.state.newNetworkId !== '' && - this.state.newNetworkName !== this.newNetworkNameDefault && this.state.newNetworkName !== '' && - this.state.newNetworkExplorer !== this.newNetworkExplorerDefault && this.state.newNetworkExplorer !== '' - ) - - return ( -
-
e.stopPropagation()}> -
- {'Networks'} -
-
-
- {this.renderNetworks()} -
- {changedNewNetwork ? ( - newNetworkReady ? ( -
- {svg.save(18)} -
- ):( -
- {svg.octicon('check', { height: 19 })} -
- ) - ):( -
- {svg.octicon('plus', { height: 17 })} -
- )} -
- { - this.setState({ newNetworkName: e.target.value }) - }} - onFocus={(e) => { - if (e.target.value === this.newNetworkNameDefault) this.setState({ newNetworkName: '' }) - }} - onBlur={(e) => { - if (e.target.value === '') this.setState({ newNetworkName: this.newNetworkNameDefault }) - }} - /> -
-
- { - if (Number(parseInt(e.target.value)) || e.target.value === '') { - this.setState({ newNetworkId: e.target.value }) - } - }} - onFocus={(e) => { - console.log(e.target.value, this.newNetworkIdDefault) - if (e.target.value === this.newNetworkIdDefault) this.setState({ newNetworkId: '' }) - }} - onBlur={(e) => { - if (e.target.value === '') this.setState({ newNetworkId: this.newNetworkIdDefault }) - }} - /> -
-
- { - this.setState({ newNetworkExplorer: e.target.value }) - }} - onFocus={(e) => { - if (e.target.value === this.newNetworkExplorerDefault) this.setState({ newNetworkExplorer: '' }) - }} - onBlur={(e) => { - if (e.target.value === '') this.setState({ newNetworkExplorer: this.newNetworkExplorerDefault }) - }} - /> -
-
-
-
-
{ this.store.notify() }}> -
Close
-
-
-
-
-
- ) - } - render () { // Instead of mounting all of these we should use a transition to mount and animate on demand return (
this.store.notify()}> @@ -471,7 +305,6 @@ class Notify extends React.Component { {this.contractData()} {this.hotAccountWarning()} {this.hotSignerMismatch()} - {this.editNetworks()}
) } diff --git a/app/App/Panel/Notify/style/index.styl b/app/App/Panel/Notify/style/index.styl index ac881a38e..c5e8da6f7 100644 --- a/app/App/Panel/Notify/style/index.styl +++ b/app/App/Panel/Notify/style/index.styl @@ -79,143 +79,6 @@ .notifyBodyLine margin-bottom 40px - .notifyNetwork - width 100% - height 480px - overflow-y scroll - padding-bottom 0px - background thin - margin -20px 0px 20px 0px - // margin-bottom 20px - border-radius 24px - - input - position absolute - top 0 - left 0 - right 0 - bottom 0 - width 100% - height 100% - border none - outline none - background transparent - text-align center - font-size 16px - // font-weight 300 - font-family Raleway, sans-serif - padding 0px 10px 0px 10px - - .notifyNetworkLine:before - content '' - position absolute - top 0 - left 0 - right 0 - bottom 2px - background highlight - z-index 2 - border-radius 16px - - .notifyNetworkLine - position relative - margin 10px - height 80px - overflow hidden - background lightShade - padding-top 1px - // box-shadow 0px 8px 30px -10px rgba(6, 54, 52, 0.25) - border-radius 16px - - div - z-index 3 - display flex - justify-content center - align-items center - - // .notifyNetworkRemove - // position absolute - // right 0 - // top 0 - // bottom 40px - // width 60px - - .notifyNetworkRemove:hover - background bad - svg - color white - - .notifyNetworkSubmit - position absolute - right 0 - top 0 - bottom 40px - width 60px - color outerspace - svg - color outerspace - - // .notifyNetworkSubmitEnabled - // background good - // svg - // color white - // filter drop-shadow(0px 2px 1px goodShade) - - .notifyNetworkSubmitEnabled:hover - background good - svg - color white - filter drop-shadow(0px 2px 1px goodShade) - - // .notifyNetworkSubmitDisabled - // // background bad - // svg - // color white - // // filter drop-shadow(0px 2px 1px badShade) - - // .notifyNetworkSubmitDisabled:hover - // background good - // svg - // color white - - .notifyNetworkName - position absolute - top 0 - left 60px - right 60px - bottom 40px - border-left 1px solid lightShade - border-right 1px solid lightShade - - input - font-size 20px - - .notifyNetworkName:hover - background highlighter - - .notifyNetworkId - position absolute - left 0 - top 0 - bottom 40px - width 60px - // background gray - - .notifyNetworkId:hover - background highlighter - - .notifyNetworkExplorer - position absolute - right 0 - left 0 - top 40px - bottom 2px - border-top 1px solid lightShade - font-size 14px - - .notifyNetworkExplorer:hover - background highlighter - .notifyInput display flex position relative diff --git a/app/App/Panel/Phase/AddAragon/index.js b/app/App/Panel/Phase/AddAragon/index.js new file mode 100644 index 000000000..a9c93f82b --- /dev/null +++ b/app/App/Panel/Phase/AddAragon/index.js @@ -0,0 +1,220 @@ +import React from 'react' +import Restore from 'react-restore' + +import link from '../../../../../link' +import svg from '../../../../../svg' + +class AddAragon extends React.Component { + constructor (...args) { + super(...args) + this.state = { + adding: false, + agent: '0x0000000000000000000000000000000000000000', + index: 0, + status: '', + error: false, + name: '' + } + this.forms = [React.createRef()] + } + + onChange (key, e) { + e.preventDefault() + const update = {} + update[key] = (e.target.value || '') // .replace(/\W/g, '') + this.setState(update) + } + + onBlur (key, e) { + e.preventDefault() + const update = {} + update[key] = this.state[key] || '' + this.setState(update) + } + + onFocus (key, e) { + e.preventDefault() + if (this.state[key] === '') { + const update = {} + update[key] = '' + this.setState(update) + } + } + + currentForm () { + return this.forms[this.state.index] + } + + blurActive () { + const formInput = this.currentForm() + if (formInput) formInput.current.blur() + } + + focusActive () { + setTimeout(() => { + const formInput = this.currentForm() + if (formInput) formInput.current.focus() + }, 500) + } + + next () { + this.blurActive() + this.setState({ index: ++this.state.index }) + this.focusActive() + } + + actorAccount (actorId) { + this.setState({ actorId }) + this.next() + } + + capitalize (s) { + if (typeof s !== 'string') return '' + return s.charAt(0).toUpperCase() + s.slice(1) + } + + actorAddress (actorAddress, actorIndex) { + link.rpc('resolveAragonName', this.state.name, (err, dao) => { + this.next() + if (err) return this.setState({ status: err, error: true }) + const aragonAccount = { + id: dao.apps.kernel.proxyAddress, + index: 0, + addresses: [dao.apps.agent.proxyAddress], // Agent Address + type: 'aragon', + name: this.capitalize(dao.name) + ' DAO', + ens: dao.ens, + network: dao.network, + smart: { + type: 'aragon', + actor: { // Reference to Frame account that will act on behalf of the agent + id: this.state.actorId, + index: actorIndex, + address: actorAddress // External Signer + }, + dao: dao.apps.kernel.proxyAddress, // DAO Address + agent: dao.apps.agent.proxyAddress // Agent Address + } + } + link.rpc('addAragon', aragonAccount, (err) => { + if (err) { + this.setState({ status: err, error: true }) + } else { + this.setState({ status: 'Successful', error: false }) + setTimeout(() => { + this.store.toggleAddAccount() + }, 2000) + } + }) + }) + } + + accountSort (a, b) { + const accounts = this.store('main.accounts') + a = accounts[a].created + b = accounts[b].created + if (a === -1 && b !== -1) return -1 + if (a !== -1 && b === -1) return 1 + if (a > b) return -1 + if (a < b) return 1 + return 0 + } + + accountFilter (id) { + // Need to update accounts to use network type + const network = this.store('main.currentNetwork.id') + const account = this.store('main.accounts', id) + if (account.type === 'aragon') return false + return account.network === network + } + + restart () { + this.setState({ adding: false, agent: '0x0000000000000000000000000000000000000000', index: 0, name: '' }) + setTimeout(() => { + this.setState({ status: '', error: false }) + }, 500) + this.focusActive() + } + + adding () { + this.setState({ adding: true }) + this.focusActive() + } + + render () { + let itemClass = 'phaseItem phaseItemSmart' + if (this.state.adding) itemClass += ' phaseItemAdding' + return ( +
+
+
+
+
+
{svg.aragon(30)}
+
+
+
Aragon
+
+
+
An Aragon smart account allows you to use your Aragon DAO with any dapp
+
+
this.adding()}> +
Add Aragon Account
+
+
+
+
+
enter dao name
+
+ this.onChange('name', e)} onFocus={e => this.onFocus('name', e)} onBlur={e => this.onBlur('name', e)} onKeyPress={e => { if (e.key === 'Enter') this.next() }} /> +
+
this.next()}>Next
+
+
+
Choose acting account
+
+ {Object.keys(this.store('main.accounts')) + .filter(id => this.accountFilter(id)) + .sort((a, b) => this.accountSort(a, b)) + .map(id => { + const account = this.store('main.accounts', id) + return
this.actorAccount(id)}>{account.name}
+ })} +
+
+
+
Choose acting address
+
+ {(this.store('main.accounts', this.state.actorId, 'addresses') || []).map((a, i) => { + return ( +
this.actorAddress(a, i)}> + {a ? a.substring(0, 10) : ''}{svg.octicon('kebab-horizontal', { height: 16 })}{a ? a.substr(a.length - 10) : ''} +
+ ) + })} +
+
+
+
{this.state.status}
+ {this.state.error ?
this.restart()}>try again
: null} +
+
+
+
+
{ + const net = this.store('main.currentNetwork.id') + const open = url => this.store.notify('openExternal', { url }) + if (net === '1') return open('https://mainnet.aragon.org') + if (net === '4') return open('https://rinkeby.aragon.org') + return open('https://aragon.org') + }} + >{'Don\'t have a dao? Create one'} +
+
+
+ ) + } +} + +export default Restore.connect(AddAragon) diff --git a/app/App/Panel/Phase/AddHardware/index.js b/app/App/Panel/Phase/AddHardware/index.js new file mode 100644 index 000000000..96a2ba600 --- /dev/null +++ b/app/App/Panel/Phase/AddHardware/index.js @@ -0,0 +1,74 @@ +import React from 'react' +import Restore from 'react-restore' + +import svg from '../../../../../svg' + +class AddHardware extends React.Component { + constructor (...args) { + super(...args) + this.state = {} + this.deviceName = this.props.type // .replace(/\b\w/g, l => l.toUpperCase()) + } + + render () { + const accounts = this.store('main.accounts') + const signers = this.store('main.signers') + let tethered = Object.keys(signers).filter(id => Object.keys(accounts).indexOf(id) > -1) + let untethered = Object.keys(signers).filter(id => Object.keys(accounts).indexOf(id) < 0) + const isType = id => this.store('main.signers', id, 'type') === this.props.type + const toDevice = id => this.store('main.signers', id) + tethered = tethered.filter(isType.bind(this)).map(toDevice.bind(this)) + untethered = untethered.filter(isType.bind(this)).map(toDevice.bind(this)) + return ( +
+
+
+
+
+
{this.props.type === 'ledger' ? svg.ledger(20) : svg.trezor(16)}
+
+
+
{this.deviceName}
+
+
+
{`Unlock your ${this.deviceName} to get started`}
+
+ {untethered.length || tethered.length ? ( + untethered.map((signer, i) => { + return ( +
+
Device Found
+
{signer.status}
+
+ ) + }).concat(tethered.map((signer, i) => { + return ( +
this.store.toggleAddAccount()}> +
Device Found
+
Account Created
+
+ ) + })) + ) : ( +
+
+ {'No Devices Found'} +
+
+ )} +
+
{ + const open = url => this.store.notify('openExternal', { url }) + if (this.deviceName === 'ledger') return open('https://shop.ledger.com/pages/ledger-nano-x?r=1fb484cde64f') + if (this.deviceName === 'trezor') return open('https://shop.trezor.io/?offer_id=10&aff_id=3270') + }} + >{`Need a signer? Get a ${this.deviceName}`} +
+
+
+ ) + } +} + +export default Restore.connect(AddHardware) diff --git a/app/App/Panel/Phase/AddPhrase/index.js b/app/App/Panel/Phase/AddPhrase/index.js new file mode 100644 index 000000000..5448320e7 --- /dev/null +++ b/app/App/Panel/Phase/AddPhrase/index.js @@ -0,0 +1,155 @@ +import React from 'react' +import Restore from 'react-restore' + +import link from '../../../../../link' +import svg from '../../../../../svg' + +class AddPhrase extends React.Component { + constructor (...args) { + super(...args) + this.state = { + index: 0, + adding: false, + phrase: '', + password: '', + status: '', + error: false + } + this.forms = [React.createRef(), React.createRef()] + } + + onChange (key, e) { + e.preventDefault() + const update = {} + const value = (e.target.value || '') + // value = value === ' ' ? '' : value + // value = value.replace(/[ \t]+/g, '_') + // value = value.replace(/\W/g, '') + // value = value.replace(/_/g, ' ') + // value = value.split(' ').length > 24 ? value.substring(0, value.lastIndexOf(' ') + 1) : value // Limit to 24 words max + update[key] = value + this.setState(update) + } + + onBlur (key, e) { + e.preventDefault() + const update = {} + update[key] = this.state[key] || '' + this.setState(update) + } + + onFocus (key, e) { + e.preventDefault() + if (this.state[key] === '') { + const update = {} + update[key] = '' + this.setState(update) + } + } + + next () { + this.setState({ index: ++this.state.index }) + this.focusActive() + } + + create () { + this.setState({ index: ++this.state.index }) + link.rpc('createFromPhrase', this.state.phrase, this.state.password, (err, signer) => { + if (err) { + this.setState({ status: err, error: true }) + } else { + this.setState({ status: 'Successful', error: false }) + setTimeout(() => { + this.store.toggleAddAccount() + }, 2000) + } + }) + } + + restart () { + this.setState({ index: 0, adding: false, phrase: '', password: '', success: false }) + setTimeout(() => { + this.setState({ status: '', error: false }) + }, 500) + this.focusActive() + } + + keyPress (e) { + if (e.key === 'Enter') { + e.preventDefault() + const formInput = this.forms[this.state.index] + if (formInput) formInput.current.blur() + if (this.state.index === 1) return this.create() + this.next() + } + } + + adding () { + this.setState({ adding: true }) + this.focusActive() + } + + focusActive () { + setTimeout(() => { + const formInput = this.forms[this.state.index] + if (formInput) formInput.current.focus() + }, 500) + } + + render () { + let itemClass = 'phaseItem phaseItemSmart' + if (this.state.adding) itemClass += ' phaseItemAdding' + return ( +
+
+
+
+
+
{svg.quote(18)}
+
+
+
Phrase
+
+
+
A phrase account uses a list of words to backup and restore your account
+
+
{ + this.adding() + if (this.store('main.currentNetwork.id') === '1') setTimeout(() => this.store.notify('hotAccountWarning'), 800) + }} + > + {'Add Phrase Account'} +
+
+
+
+
seed phrase
+
+