mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-22 17:33:23 +01:00
Auto linted
This commit is contained in:
parent
f7f8f8b1c5
commit
a08c3bc01b
@ -1,5 +1,4 @@
|
|||||||
{
|
{
|
||||||
"parser": "babel-eslint",
|
|
||||||
"parserOptions": {
|
"parserOptions": {
|
||||||
"ecmaVersion": 6,
|
"ecmaVersion": 6,
|
||||||
"ecmaFeatures": {
|
"ecmaFeatures": {
|
||||||
|
@ -138,7 +138,6 @@ function storeSetFromObj(store, obj){
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// remote features
|
// remote features
|
||||||
//
|
//
|
||||||
@ -149,7 +148,6 @@ function setupPublicConfig(stream){
|
|||||||
}
|
}
|
||||||
|
|
||||||
function setupProviderConnection (stream, originDomain) {
|
function setupProviderConnection (stream, originDomain) {
|
||||||
|
|
||||||
stream.on('data', function onRpcRequest (payload) {
|
stream.on('data', function onRpcRequest (payload) {
|
||||||
// Append origin to rpc payload
|
// Append origin to rpc payload
|
||||||
payload.origin = originDomain
|
payload.origin = originDomain
|
||||||
@ -161,6 +159,9 @@ function setupProviderConnection(stream, originDomain){
|
|||||||
}
|
}
|
||||||
// handle rpc request
|
// handle rpc request
|
||||||
provider.sendAsync(payload, function onPayloadHandled (err, response) {
|
provider.sendAsync(payload, function onPayloadHandled (err, response) {
|
||||||
|
if (err) {
|
||||||
|
return logger(err)
|
||||||
|
}
|
||||||
logger(null, payload, response)
|
logger(null, payload, response)
|
||||||
try {
|
try {
|
||||||
stream.write(response)
|
stream.write(response)
|
||||||
@ -205,7 +206,6 @@ function setupControllerConnection(stream){
|
|||||||
})
|
})
|
||||||
stream.pipe(dnode).pipe(stream)
|
stream.pipe(dnode).pipe(stream)
|
||||||
dnode.on('remote', function (remote) {
|
dnode.on('remote', function (remote) {
|
||||||
|
|
||||||
// push updates to popup
|
// push updates to popup
|
||||||
ethStore.on('update', sendUpdate)
|
ethStore.on('update', sendUpdate)
|
||||||
idStore.on('update', sendUpdate)
|
idStore.on('update', sendUpdate)
|
||||||
@ -217,7 +217,6 @@ function setupControllerConnection(stream){
|
|||||||
var state = getState()
|
var state = getState()
|
||||||
remote.sendUpdate(state)
|
remote.sendUpdate(state)
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -263,7 +262,6 @@ function newUnsignedMessage(msgParams, cb){
|
|||||||
createUnlockRequestNotification({
|
createUnlockRequestNotification({
|
||||||
title: 'Account Unlock Request',
|
title: 'Account Unlock Request',
|
||||||
})
|
})
|
||||||
var msgId = idStore.addUnconfirmedMessage(msgParams, cb)
|
|
||||||
} else {
|
} else {
|
||||||
addUnconfirmedMsg(msgParams, cb)
|
addUnconfirmedMsg(msgParams, cb)
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -2,8 +2,6 @@ const LocalMessageDuplexStream = require('./lib/local-message-stream.js')
|
|||||||
const PortStream = require('./lib/port-stream.js')
|
const PortStream = require('./lib/port-stream.js')
|
||||||
const ObjectMultiplex = require('./lib/obj-multiplex')
|
const ObjectMultiplex = require('./lib/obj-multiplex')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// inject in-page script
|
// inject in-page script
|
||||||
var scriptTag = document.createElement('script')
|
var scriptTag = document.createElement('script')
|
||||||
scriptTag.src = chrome.extension.getURL('scripts/inpage.js')
|
scriptTag.src = chrome.extension.getURL('scripts/inpage.js')
|
||||||
|
@ -8,7 +8,6 @@ restoreContextAfterImports()
|
|||||||
// remove from window
|
// remove from window
|
||||||
delete window.Web3
|
delete window.Web3
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// setup plugin communication
|
// setup plugin communication
|
||||||
//
|
//
|
||||||
@ -51,7 +50,7 @@ inpageProvider.publicConfigStore.subscribe(function(state){
|
|||||||
// need to make sure we aren't affected by overlapping namespaces
|
// need to make sure we aren't affected by overlapping namespaces
|
||||||
// and that we dont affect the app with our namespace
|
// and that we dont affect the app with our namespace
|
||||||
// mostly a fix for web3's BigNumber if AMD's "define" is defined...
|
// mostly a fix for web3's BigNumber if AMD's "define" is defined...
|
||||||
var __define = undefined
|
var __define
|
||||||
|
|
||||||
function cleanContextForImports () {
|
function cleanContextForImports () {
|
||||||
__define = global.define
|
__define = global.define
|
||||||
|
@ -1,11 +1,9 @@
|
|||||||
var uri = 'https://faucet.metamask.io/'
|
var uri = 'https://faucet.metamask.io/'
|
||||||
|
|
||||||
module.exports = function (address) {
|
module.exports = function (address) {
|
||||||
|
|
||||||
var http = new XMLHttpRequest()
|
var http = new XMLHttpRequest()
|
||||||
var data = address
|
var data = address
|
||||||
http.open('POST', uri, true)
|
http.open('POST', uri, true)
|
||||||
http.setRequestHeader('Content-type', 'application/rawdata')
|
http.setRequestHeader('Content-type', 'application/rawdata')
|
||||||
http.send(data)
|
http.send(data)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -3,9 +3,7 @@ const ensnare = require('./ensnare.js')
|
|||||||
|
|
||||||
module.exports = setupDappAutoReload
|
module.exports = setupDappAutoReload
|
||||||
|
|
||||||
|
|
||||||
function setupDappAutoReload (web3, controlStream) {
|
function setupDappAutoReload (web3, controlStream) {
|
||||||
|
|
||||||
// export web3 as a global, checking for usage
|
// export web3 as a global, checking for usage
|
||||||
var pageIsUsingWeb3 = false
|
var pageIsUsingWeb3 = false
|
||||||
var resetWasRequested = false
|
var resetWasRequested = false
|
||||||
@ -33,5 +31,4 @@ function setupDappAutoReload(web3, controlStream){
|
|||||||
global.location.reload()
|
global.location.reload()
|
||||||
}, 500)
|
}, 500)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -7,7 +7,6 @@ const STORAGE_KEY = 'metamask-config'
|
|||||||
const TESTNET_RPC = MetamaskConfig.network.testnet
|
const TESTNET_RPC = MetamaskConfig.network.testnet
|
||||||
const MAINNET_RPC = MetamaskConfig.network.mainnet
|
const MAINNET_RPC = MetamaskConfig.network.mainnet
|
||||||
|
|
||||||
|
|
||||||
/* The config-manager is a convenience object
|
/* The config-manager is a convenience object
|
||||||
* wrapping a pojo-migrator.
|
* wrapping a pojo-migrator.
|
||||||
*
|
*
|
||||||
@ -62,7 +61,7 @@ ConfigManager.prototype.getConfig = function() {
|
|||||||
return {
|
return {
|
||||||
provider: {
|
provider: {
|
||||||
type: 'testnet',
|
type: 'testnet',
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -234,17 +233,17 @@ ConfigManager.prototype.updateTx = function(tx) {
|
|||||||
|
|
||||||
ConfigManager.prototype.getWalletNicknames = function () {
|
ConfigManager.prototype.getWalletNicknames = function () {
|
||||||
var data = this.getData()
|
var data = this.getData()
|
||||||
let nicknames = ('walletNicknames' in data) ? data.walletNicknames : {}
|
const nicknames = ('walletNicknames' in data) ? data.walletNicknames : {}
|
||||||
return nicknames
|
return nicknames
|
||||||
}
|
}
|
||||||
|
|
||||||
ConfigManager.prototype.nicknameForWallet = function (account) {
|
ConfigManager.prototype.nicknameForWallet = function (account) {
|
||||||
let nicknames = this.getWalletNicknames()
|
const nicknames = this.getWalletNicknames()
|
||||||
return nicknames[account]
|
return nicknames[account]
|
||||||
}
|
}
|
||||||
|
|
||||||
ConfigManager.prototype.setNicknameForWallet = function (account, nickname) {
|
ConfigManager.prototype.setNicknameForWallet = function (account, nickname) {
|
||||||
let nicknames = this.getWalletNicknames()
|
const nicknames = this.getWalletNicknames()
|
||||||
nicknames[account] = nickname
|
nicknames[account] = nickname
|
||||||
var data = this.getData()
|
var data = this.getData()
|
||||||
data.walletNicknames = nicknames
|
data.walletNicknames = nicknames
|
||||||
@ -281,9 +280,7 @@ ConfigManager.prototype.getConfirmed = function() {
|
|||||||
return ('isConfirmed' in data) && data.isConfirmed
|
return ('isConfirmed' in data) && data.isConfirmed
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function loadData () {
|
function loadData () {
|
||||||
|
|
||||||
var oldData = getOldStyleData()
|
var oldData = getOldStyleData()
|
||||||
var newData
|
var newData
|
||||||
try {
|
try {
|
||||||
@ -298,10 +295,10 @@ function loadData() {
|
|||||||
config: {
|
config: {
|
||||||
provider: {
|
provider: {
|
||||||
type: 'testnet',
|
type: 'testnet',
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}, oldData ? oldData : null, newData ? newData : null)
|
}, oldData || null, newData || null)
|
||||||
return data
|
return data
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ function ensnare(obj, cb){
|
|||||||
default:
|
default:
|
||||||
Object.defineProperty(proxy, key, {
|
Object.defineProperty(proxy, key, {
|
||||||
get: function () { cb(); return obj[key] },
|
get: function () { cb(); return obj[key] },
|
||||||
set: function(val){ cb(); return obj[key] = val },
|
set: function (val) { cb(); obj[key] = val; return val },
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -41,12 +41,12 @@ function IdManagement(opts) {
|
|||||||
|
|
||||||
this.signMsg = function (address, message) {
|
this.signMsg = function (address, message) {
|
||||||
// sign message
|
// sign message
|
||||||
var privKeyHex = this.exportPrivateKey(address);
|
var privKeyHex = this.exportPrivateKey(address)
|
||||||
var privKey = ethUtil.toBuffer(privKeyHex);
|
var privKey = ethUtil.toBuffer(privKeyHex)
|
||||||
var msgSig = ethUtil.ecsign(new Buffer(message.replace('0x',''), 'hex'), privKey);
|
var msgSig = ethUtil.ecsign(new Buffer(message.replace('0x', ''), 'hex'), privKey)
|
||||||
var rawMsgSig = ethUtil.bufferToHex(concatSig(msgSig.v, msgSig.r, msgSig.s));
|
var rawMsgSig = ethUtil.bufferToHex(concatSig(msgSig.v, msgSig.r, msgSig.s))
|
||||||
return rawMsgSig;
|
return rawMsgSig
|
||||||
};
|
}
|
||||||
|
|
||||||
this.getSeed = function () {
|
this.getSeed = function () {
|
||||||
return this.keyStore.getSeed(this.derivedKey)
|
return this.keyStore.getSeed(this.derivedKey)
|
||||||
@ -59,11 +59,11 @@ function IdManagement(opts) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function pad_with_zeroes (number, length) {
|
function pad_with_zeroes (number, length) {
|
||||||
var my_string = '' + number;
|
var my_string = '' + number
|
||||||
while (my_string.length < length) {
|
while (my_string.length < length) {
|
||||||
my_string = '0' + my_string;
|
my_string = '0' + my_string
|
||||||
}
|
}
|
||||||
return my_string;
|
return my_string
|
||||||
}
|
}
|
||||||
|
|
||||||
function concatSig (v, r, s) {
|
function concatSig (v, r, s) {
|
||||||
|
@ -15,10 +15,8 @@ const messageManager = require('./message-manager')
|
|||||||
const DEFAULT_RPC = 'https://testrpc.metamask.io/'
|
const DEFAULT_RPC = 'https://testrpc.metamask.io/'
|
||||||
const IdManagement = require('./id-management')
|
const IdManagement = require('./id-management')
|
||||||
|
|
||||||
|
|
||||||
module.exports = IdentityStore
|
module.exports = IdentityStore
|
||||||
|
|
||||||
|
|
||||||
inherits(IdentityStore, EventEmitter)
|
inherits(IdentityStore, EventEmitter)
|
||||||
function IdentityStore (opts = {}) {
|
function IdentityStore (opts = {}) {
|
||||||
EventEmitter.call(this)
|
EventEmitter.call(this)
|
||||||
@ -142,7 +140,6 @@ IdentityStore.prototype.revealAccount = function(cb) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
IdentityStore.prototype.getNetwork = function (err) {
|
IdentityStore.prototype.getNetwork = function (err) {
|
||||||
|
|
||||||
if (err) {
|
if (err) {
|
||||||
this._currentState.network = 'loading'
|
this._currentState.network = 'loading'
|
||||||
this._didUpdate()
|
this._didUpdate()
|
||||||
@ -232,7 +229,6 @@ IdentityStore.prototype.addUnconfirmedTransaction = function(txParams, onTxDoneC
|
|||||||
// signal completion of add tx
|
// signal completion of add tx
|
||||||
cb(null, txData)
|
cb(null, txData)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// comes from metamask ui
|
// comes from metamask ui
|
||||||
@ -279,7 +275,6 @@ IdentityStore.prototype.signTransaction = function(txParams, cb){
|
|||||||
|
|
||||||
// comes from dapp via zero-client hooked-wallet provider
|
// comes from dapp via zero-client hooked-wallet provider
|
||||||
IdentityStore.prototype.addUnconfirmedMessage = function (msgParams, cb) {
|
IdentityStore.prototype.addUnconfirmedMessage = function (msgParams, cb) {
|
||||||
|
|
||||||
// create txData obj with parameters and meta data
|
// create txData obj with parameters and meta data
|
||||||
var time = (new Date()).getTime()
|
var time = (new Date()).getTime()
|
||||||
var msgId = createId()
|
var msgId = createId()
|
||||||
@ -448,7 +443,7 @@ IdentityStore.prototype._createIdmgmt = function(password, seed, entropy, cb){
|
|||||||
|
|
||||||
IdentityStore.prototype._restoreFromSeed = function (password, seed, derivedKey) {
|
IdentityStore.prototype._restoreFromSeed = function (password, seed, derivedKey) {
|
||||||
var keyStore = new LightwalletKeyStore(seed, derivedKey, this.hdPathString)
|
var keyStore = new LightwalletKeyStore(seed, derivedKey, this.hdPathString)
|
||||||
keyStore.addHdDerivationPath(this.hdPathString, derivedKey, {curve: 'secp256k1', purpose: 'sign'});
|
keyStore.addHdDerivationPath(this.hdPathString, derivedKey, {curve: 'secp256k1', purpose: 'sign'})
|
||||||
keyStore.setDefaultHdDerivationPath(this.hdPathString)
|
keyStore.setDefaultHdDerivationPath(this.hdPathString)
|
||||||
|
|
||||||
keyStore.generateNewAddress(derivedKey, 3)
|
keyStore.generateNewAddress(derivedKey, 3)
|
||||||
@ -460,7 +455,7 @@ IdentityStore.prototype._restoreFromSeed = function(password, seed, derivedKey)
|
|||||||
IdentityStore.prototype._createFirstWallet = function (entropy, derivedKey) {
|
IdentityStore.prototype._createFirstWallet = function (entropy, derivedKey) {
|
||||||
var secretSeed = LightwalletKeyStore.generateRandomSeed(entropy)
|
var secretSeed = LightwalletKeyStore.generateRandomSeed(entropy)
|
||||||
var keyStore = new LightwalletKeyStore(secretSeed, derivedKey, this.hdPathString)
|
var keyStore = new LightwalletKeyStore(secretSeed, derivedKey, this.hdPathString)
|
||||||
keyStore.addHdDerivationPath(this.hdPathString, derivedKey, {curve: 'secp256k1', purpose: 'sign'});
|
keyStore.addHdDerivationPath(this.hdPathString, derivedKey, {curve: 'secp256k1', purpose: 'sign'})
|
||||||
keyStore.setDefaultHdDerivationPath(this.hdPathString)
|
keyStore.setDefaultHdDerivationPath(this.hdPathString)
|
||||||
|
|
||||||
keyStore.generateNewAddress(derivedKey, 3)
|
keyStore.generateNewAddress(derivedKey, 3)
|
||||||
|
@ -7,7 +7,6 @@ const MetamaskConfig = require('../config.js')
|
|||||||
|
|
||||||
module.exports = MetamaskInpageProvider
|
module.exports = MetamaskInpageProvider
|
||||||
|
|
||||||
|
|
||||||
function MetamaskInpageProvider (connectionStream) {
|
function MetamaskInpageProvider (connectionStream) {
|
||||||
const self = this
|
const self = this
|
||||||
|
|
||||||
|
@ -3,7 +3,6 @@ const inherits = require('util').inherits
|
|||||||
|
|
||||||
module.exports = LocalMessageDuplexStream
|
module.exports = LocalMessageDuplexStream
|
||||||
|
|
||||||
|
|
||||||
inherits(LocalMessageDuplexStream, Duplex)
|
inherits(LocalMessageDuplexStream, Duplex)
|
||||||
|
|
||||||
function LocalMessageDuplexStream (opts) {
|
function LocalMessageDuplexStream (opts) {
|
||||||
|
@ -11,7 +11,6 @@ module.exports = {
|
|||||||
setupListeners()
|
setupListeners()
|
||||||
|
|
||||||
function setupListeners () {
|
function setupListeners () {
|
||||||
|
|
||||||
// guard for chrome bug https://github.com/MetaMask/metamask-plugin/issues/236
|
// guard for chrome bug https://github.com/MetaMask/metamask-plugin/issues/236
|
||||||
if (!chrome.notifications) return console.error('Chrome notifications API missing...')
|
if (!chrome.notifications) return console.error('Chrome notifications API missing...')
|
||||||
|
|
||||||
@ -30,7 +29,6 @@ function setupListeners(){
|
|||||||
chrome.notifications.onClosed.addListener(function (notificationId) {
|
chrome.notifications.onClosed.addListener(function (notificationId) {
|
||||||
delete notificationHandlers[notificationId]
|
delete notificationHandlers[notificationId]
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// creation helper
|
// creation helper
|
||||||
@ -46,7 +44,6 @@ function createUnlockRequestNotification(opts){
|
|||||||
title: opts.title,
|
title: opts.title,
|
||||||
message: message,
|
message: message,
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function createTxNotification (opts) {
|
function createTxNotification (opts) {
|
||||||
@ -71,7 +68,7 @@ function createTxNotification(opts){
|
|||||||
title: 'confirm',
|
title: 'confirm',
|
||||||
}, {
|
}, {
|
||||||
title: 'cancel',
|
title: 'cancel',
|
||||||
}]
|
}],
|
||||||
})
|
})
|
||||||
notificationHandlers[id] = {
|
notificationHandlers[id] = {
|
||||||
confirm: opts.confirm,
|
confirm: opts.confirm,
|
||||||
@ -99,7 +96,7 @@ function createMsgNotification(opts){
|
|||||||
title: 'confirm',
|
title: 'confirm',
|
||||||
}, {
|
}, {
|
||||||
title: 'cancel',
|
title: 'cancel',
|
||||||
}]
|
}],
|
||||||
})
|
})
|
||||||
notificationHandlers[id] = {
|
notificationHandlers[id] = {
|
||||||
confirm: opts.confirm,
|
confirm: opts.confirm,
|
||||||
|
@ -2,7 +2,6 @@ const through = require('through2')
|
|||||||
|
|
||||||
module.exports = ObjectMultiplex
|
module.exports = ObjectMultiplex
|
||||||
|
|
||||||
|
|
||||||
function ObjectMultiplex (opts) {
|
function ObjectMultiplex (opts) {
|
||||||
opts = opts || {}
|
opts = opts || {}
|
||||||
// create multiplexer
|
// create multiplexer
|
||||||
|
@ -3,7 +3,6 @@ const inherits = require('util').inherits
|
|||||||
|
|
||||||
module.exports = PortDuplexStream
|
module.exports = PortDuplexStream
|
||||||
|
|
||||||
|
|
||||||
inherits(PortDuplexStream, Duplex)
|
inherits(PortDuplexStream, Duplex)
|
||||||
|
|
||||||
function PortDuplexStream (port) {
|
function PortDuplexStream (port) {
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
const Through = require('through2')
|
const Through = require('through2')
|
||||||
const ObjectMultiplex = require('./obj-multiplex')
|
const ObjectMultiplex = require('./obj-multiplex')
|
||||||
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
jsonParseStream: jsonParseStream,
|
jsonParseStream: jsonParseStream,
|
||||||
jsonStringifyStream: jsonStringifyStream,
|
jsonStringifyStream: jsonStringifyStream,
|
||||||
|
@ -9,5 +9,5 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
return data
|
return data
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
@ -11,5 +11,5 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
return data
|
return data
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
@ -7,16 +7,16 @@ module.exports = {
|
|||||||
switch (data.config.provider.rpcTarget) {
|
switch (data.config.provider.rpcTarget) {
|
||||||
case 'https://testrpc.metamask.io/':
|
case 'https://testrpc.metamask.io/':
|
||||||
data.config.provider = {
|
data.config.provider = {
|
||||||
type: 'testnet'
|
type: 'testnet',
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
case 'https://rpc.metamask.io/':
|
case 'https://rpc.metamask.io/':
|
||||||
data.config.provider = {
|
data.config.provider = {
|
||||||
type: 'mainnet'
|
type: 'mainnet',
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
} catch (_) {}
|
} catch (_) {}
|
||||||
return data
|
return data
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
@ -88,7 +88,7 @@ AccountDetailScreen.prototype.render = function() {
|
|||||||
style: {
|
style: {
|
||||||
height: '62px',
|
height: '62px',
|
||||||
paddingTop: '8px',
|
paddingTop: '8px',
|
||||||
}
|
},
|
||||||
}, [
|
}, [
|
||||||
h(EditableLabel, {
|
h(EditableLabel, {
|
||||||
textValue: identity ? identity.name : '',
|
textValue: identity ? identity.name : '',
|
||||||
@ -211,7 +211,7 @@ AccountDetailScreen.prototype.transactionList = function() {
|
|||||||
unconfMsgs,
|
unconfMsgs,
|
||||||
viewPendingTx: (txId) => {
|
viewPendingTx: (txId) => {
|
||||||
this.props.dispatch(actions.viewPendingTx(txId))
|
this.props.dispatch(actions.viewPendingTx(txId))
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,7 +9,6 @@ const Identicon = require('../components/identicon')
|
|||||||
|
|
||||||
module.exports = NewComponent
|
module.exports = NewComponent
|
||||||
|
|
||||||
|
|
||||||
inherits(NewComponent, Component)
|
inherits(NewComponent, Component)
|
||||||
function NewComponent () {
|
function NewComponent () {
|
||||||
Component.call(this)
|
Component.call(this)
|
||||||
@ -35,7 +34,7 @@ NewComponent.prototype.render = function() {
|
|||||||
h('.identicon-wrapper.flex-column.flex-center.select-none', [
|
h('.identicon-wrapper.flex-column.flex-center.select-none', [
|
||||||
this.pendingOrNot(),
|
this.pendingOrNot(),
|
||||||
h(Identicon, {
|
h(Identicon, {
|
||||||
address: identity.address
|
address: identity.address,
|
||||||
}),
|
}),
|
||||||
]),
|
]),
|
||||||
|
|
||||||
@ -68,7 +67,7 @@ NewComponent.prototype.render = function() {
|
|||||||
event.stopPropagation()
|
event.stopPropagation()
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
copyToClipboard(ethUtil.toChecksumAddress(identity.address))
|
copyToClipboard(ethUtil.toChecksumAddress(identity.address))
|
||||||
}
|
},
|
||||||
}),
|
}),
|
||||||
]),
|
]),
|
||||||
])
|
])
|
||||||
|
@ -10,7 +10,6 @@ const AccountPanel = require('./account-panel')
|
|||||||
|
|
||||||
module.exports = connect(mapStateToProps)(AccountsScreen)
|
module.exports = connect(mapStateToProps)(AccountsScreen)
|
||||||
|
|
||||||
|
|
||||||
function mapStateToProps (state) {
|
function mapStateToProps (state) {
|
||||||
const pendingTxs = valuesFor(state.metamask.unconfTxs)
|
const pendingTxs = valuesFor(state.metamask.unconfTxs)
|
||||||
const pendingMsgs = valuesFor(state.metamask.unconfMsgs)
|
const pendingMsgs = valuesFor(state.metamask.unconfMsgs)
|
||||||
@ -32,7 +31,6 @@ function AccountsScreen() {
|
|||||||
Component.call(this)
|
Component.call(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
AccountsScreen.prototype.render = function () {
|
AccountsScreen.prototype.render = function () {
|
||||||
var state = this.props
|
var state = this.props
|
||||||
var identityList = valuesFor(state.identities)
|
var identityList = valuesFor(state.identities)
|
||||||
@ -63,7 +61,7 @@ AccountsScreen.prototype.render = function() {
|
|||||||
height: '418px',
|
height: '418px',
|
||||||
overflowY: 'auto',
|
overflowY: 'auto',
|
||||||
overflowX: 'hidden',
|
overflowX: 'hidden',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
[
|
[
|
||||||
identityList.map((identity) => {
|
identityList.map((identity) => {
|
||||||
@ -100,7 +98,7 @@ AccountsScreen.prototype.render = function() {
|
|||||||
paddint: '10px',
|
paddint: '10px',
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
}
|
},
|
||||||
}, [
|
}, [
|
||||||
h('i.fa.fa-plus.fa-lg', {key: ''}),
|
h('i.fa.fa-plus.fa-lg', {key: ''}),
|
||||||
]),
|
]),
|
||||||
|
@ -296,7 +296,6 @@ function cancelTx(txData){
|
|||||||
// initialize screen
|
// initialize screen
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
function showCreateVault () {
|
function showCreateVault () {
|
||||||
return {
|
return {
|
||||||
type: actions.SHOW_CREATE_VAULT,
|
type: actions.SHOW_CREATE_VAULT,
|
||||||
|
@ -33,7 +33,6 @@ const NetworkIndicator = require('./components/network')
|
|||||||
|
|
||||||
module.exports = connect(mapStateToProps)(App)
|
module.exports = connect(mapStateToProps)(App)
|
||||||
|
|
||||||
|
|
||||||
inherits(App, Component)
|
inherits(App, Component)
|
||||||
function App () { Component.call(this) }
|
function App () { Component.call(this) }
|
||||||
|
|
||||||
@ -65,7 +64,7 @@ App.prototype.render = function() {
|
|||||||
style: {
|
style: {
|
||||||
// Windows was showing a vertical scroll bar:
|
// Windows was showing a vertical scroll bar:
|
||||||
overflow: 'hidden',
|
overflow: 'hidden',
|
||||||
}
|
},
|
||||||
}, [
|
}, [
|
||||||
|
|
||||||
h(LoadingIndicator),
|
h(LoadingIndicator),
|
||||||
@ -80,7 +79,7 @@ App.prototype.render = function() {
|
|||||||
style: {
|
style: {
|
||||||
height: '380px',
|
height: '380px',
|
||||||
width: '360px',
|
width: '360px',
|
||||||
}
|
},
|
||||||
}, [
|
}, [
|
||||||
h(ReactCSSTransitionGroup, {
|
h(ReactCSSTransitionGroup, {
|
||||||
className: 'css-transition-group',
|
className: 'css-transition-group',
|
||||||
@ -121,7 +120,7 @@ App.prototype.renderAppBar = function(){
|
|||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
event.stopPropagation()
|
event.stopPropagation()
|
||||||
this.setState({ isNetworkMenuOpen: !isNetworkMenuOpen })
|
this.setState({ isNetworkMenuOpen: !isNetworkMenuOpen })
|
||||||
}
|
},
|
||||||
}),
|
}),
|
||||||
|
|
||||||
// metamask name
|
// metamask name
|
||||||
@ -252,7 +251,6 @@ App.prototype.renderPrimary = function(){
|
|||||||
|
|
||||||
// show initialize screen
|
// show initialize screen
|
||||||
if (!props.isInitialized) {
|
if (!props.isInitialized) {
|
||||||
|
|
||||||
// show current view
|
// show current view
|
||||||
switch (props.currentView.name) {
|
switch (props.currentView.name) {
|
||||||
|
|
||||||
|
@ -6,14 +6,13 @@ const actions = require('../actions')
|
|||||||
|
|
||||||
module.exports = ExportAccountView
|
module.exports = ExportAccountView
|
||||||
|
|
||||||
|
|
||||||
inherits(ExportAccountView, Component)
|
inherits(ExportAccountView, Component)
|
||||||
function ExportAccountView () {
|
function ExportAccountView () {
|
||||||
Component.call(this)
|
Component.call(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
ExportAccountView.prototype.render = function () {
|
ExportAccountView.prototype.render = function () {
|
||||||
console.log("EXPORT VIEW")
|
console.log('EXPORT VIEW')
|
||||||
console.dir(this.props)
|
console.dir(this.props)
|
||||||
var state = this.props
|
var state = this.props
|
||||||
var accountDetail = state.accountDetail
|
var accountDetail = state.accountDetail
|
||||||
@ -47,13 +46,13 @@ ExportAccountView.prototype.render = function() {
|
|||||||
style: {
|
style: {
|
||||||
position: 'relative',
|
position: 'relative',
|
||||||
top: '1.5px',
|
top: '1.5px',
|
||||||
}
|
},
|
||||||
}),
|
}),
|
||||||
h('button', {
|
h('button', {
|
||||||
onClick: () => this.onExportKeyPress({ key: 'Enter', preventDefault: () => {} }),
|
onClick: () => this.onExportKeyPress({ key: 'Enter', preventDefault: () => {} }),
|
||||||
}, 'Submit'),
|
}, 'Submit'),
|
||||||
h('button', {
|
h('button', {
|
||||||
onClick: () => this.props.dispatch(actions.backToAccountDetail(this.props.address))
|
onClick: () => this.props.dispatch(actions.backToAccountDetail(this.props.address)),
|
||||||
}, 'Cancel'),
|
}, 'Cancel'),
|
||||||
])
|
])
|
||||||
|
|
||||||
@ -74,10 +73,10 @@ ExportAccountView.prototype.render = function() {
|
|||||||
},
|
},
|
||||||
onClick: function (event) {
|
onClick: function (event) {
|
||||||
copyToClipboard(accountDetail.privateKey)
|
copyToClipboard(accountDetail.privateKey)
|
||||||
}
|
},
|
||||||
}, accountDetail.privateKey),
|
}, accountDetail.privateKey),
|
||||||
h('button', {
|
h('button', {
|
||||||
onClick: () => this.props.dispatch(actions.backToAccountDetail(this.props.address))
|
onClick: () => this.props.dispatch(actions.backToAccountDetail(this.props.address)),
|
||||||
}, 'Done'),
|
}, 'Done'),
|
||||||
])
|
])
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,6 @@ const Panel = require('./panel')
|
|||||||
|
|
||||||
module.exports = AccountPanel
|
module.exports = AccountPanel
|
||||||
|
|
||||||
|
|
||||||
inherits(AccountPanel, Component)
|
inherits(AccountPanel, Component)
|
||||||
function AccountPanel () {
|
function AccountPanel () {
|
||||||
Component.call(this)
|
Component.call(this)
|
||||||
@ -40,18 +39,16 @@ AccountPanel.prototype.render = function() {
|
|||||||
value: addressSummary(identity.address),
|
value: addressSummary(identity.address),
|
||||||
},
|
},
|
||||||
balanceOrFaucetingIndication(account, isFauceting),
|
balanceOrFaucetingIndication(account, isFauceting),
|
||||||
]
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
return h(Panel, panelOpts,
|
return h(Panel, panelOpts,
|
||||||
!state.onShowDetail ? null : h('.arrow-right.cursor-pointer', [
|
!state.onShowDetail ? null : h('.arrow-right.cursor-pointer', [
|
||||||
h('i.fa.fa-chevron-right.fa-lg'),
|
h('i.fa.fa-chevron-right.fa-lg'),
|
||||||
]))
|
]))
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function balanceOrFaucetingIndication (account, isFauceting) {
|
function balanceOrFaucetingIndication (account, isFauceting) {
|
||||||
|
|
||||||
// Temporarily deactivating isFauceting indication
|
// Temporarily deactivating isFauceting indication
|
||||||
// because it shows fauceting for empty restored accounts.
|
// because it shows fauceting for empty restored accounts.
|
||||||
if (/* isFauceting*/ false) {
|
if (/* isFauceting*/ false) {
|
||||||
@ -62,7 +59,7 @@ function balanceOrFaucetingIndication(account, isFauceting) {
|
|||||||
} else {
|
} else {
|
||||||
return {
|
return {
|
||||||
key: 'BALANCE',
|
key: 'BALANCE',
|
||||||
value: formatBalance(account.balance)
|
value: formatBalance(account.balance),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,14 +4,12 @@ const inherits = require('util').inherits
|
|||||||
|
|
||||||
module.exports = DropMenuItem
|
module.exports = DropMenuItem
|
||||||
|
|
||||||
|
|
||||||
inherits(DropMenuItem, Component)
|
inherits(DropMenuItem, Component)
|
||||||
function DropMenuItem () {
|
function DropMenuItem () {
|
||||||
Component.call(this)
|
Component.call(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
DropMenuItem.prototype.render = function () {
|
DropMenuItem.prototype.render = function () {
|
||||||
|
|
||||||
return h('li.drop-menu-item', {
|
return h('li.drop-menu-item', {
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
this.props.closeMenu()
|
this.props.closeMenu()
|
||||||
|
@ -5,7 +5,6 @@ const findDOMNode = require('react-dom').findDOMNode
|
|||||||
|
|
||||||
module.exports = EditableLabel
|
module.exports = EditableLabel
|
||||||
|
|
||||||
|
|
||||||
inherits(EditableLabel, Component)
|
inherits(EditableLabel, Component)
|
||||||
function EditableLabel () {
|
function EditableLabel () {
|
||||||
Component.call(this)
|
Component.call(this)
|
||||||
@ -16,7 +15,6 @@ EditableLabel.prototype.render = function() {
|
|||||||
let state = this.state
|
let state = this.state
|
||||||
|
|
||||||
if (state && state.isEditingLabel) {
|
if (state && state.isEditingLabel) {
|
||||||
|
|
||||||
return h('div.editable-label', [
|
return h('div.editable-label', [
|
||||||
h('input.sizing-input', {
|
h('input.sizing-input', {
|
||||||
defaultValue: props.textValue,
|
defaultValue: props.textValue,
|
||||||
@ -26,9 +24,8 @@ EditableLabel.prototype.render = function() {
|
|||||||
}),
|
}),
|
||||||
h('button.editable-button', {
|
h('button.editable-button', {
|
||||||
onClick: () => this.saveText(),
|
onClick: () => this.saveText(),
|
||||||
}, 'Save')
|
}, 'Save'),
|
||||||
])
|
])
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
return h('div.name-label', {
|
return h('div.name-label', {
|
||||||
onClick: (event) => {
|
onClick: (event) => {
|
||||||
|
@ -7,7 +7,6 @@ const debounce = require('debounce')
|
|||||||
|
|
||||||
module.exports = Mascot
|
module.exports = Mascot
|
||||||
|
|
||||||
|
|
||||||
inherits(Mascot, Component)
|
inherits(Mascot, Component)
|
||||||
function Mascot () {
|
function Mascot () {
|
||||||
Component.call(this)
|
Component.call(this)
|
||||||
@ -22,7 +21,6 @@ function Mascot() {
|
|||||||
this.unfollowMouse = this.logo.setFollowMouse.bind(this.logo, false)
|
this.unfollowMouse = this.logo.setFollowMouse.bind(this.logo, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Mascot.prototype.render = function () {
|
Mascot.prototype.render = function () {
|
||||||
// this is a bit hacky
|
// this is a bit hacky
|
||||||
// the event emitter is on `this.props`
|
// the event emitter is on `this.props`
|
||||||
|
@ -14,7 +14,7 @@ Network.prototype.render = function() {
|
|||||||
const state = this.props
|
const state = this.props
|
||||||
const networkNumber = state.network
|
const networkNumber = state.network
|
||||||
let iconName, hoverText
|
let iconName, hoverText
|
||||||
const imagePath = "/images/"
|
const imagePath = '/images/'
|
||||||
|
|
||||||
if (networkNumber == 'loading') {
|
if (networkNumber == 'loading') {
|
||||||
return h('img', {
|
return h('img', {
|
||||||
@ -22,7 +22,7 @@ Network.prototype.render = function() {
|
|||||||
onClick: (event) => this.props.onClick(event),
|
onClick: (event) => this.props.onClick(event),
|
||||||
style: {
|
style: {
|
||||||
width: '27px',
|
width: '27px',
|
||||||
marginRight: '-27px'
|
marginRight: '-27px',
|
||||||
},
|
},
|
||||||
src: 'images/loading.svg',
|
src: 'images/loading.svg',
|
||||||
})
|
})
|
||||||
@ -30,10 +30,10 @@ Network.prototype.render = function() {
|
|||||||
hoverText = 'Main Ethereum Network'
|
hoverText = 'Main Ethereum Network'
|
||||||
iconName = 'ethereum-network'
|
iconName = 'ethereum-network'
|
||||||
} else if (parseInt(networkNumber) == 2) {
|
} else if (parseInt(networkNumber) == 2) {
|
||||||
hoverText = "Morden Test Network"
|
hoverText = 'Morden Test Network'
|
||||||
iconName = 'morden-test-network'
|
iconName = 'morden-test-network'
|
||||||
} else {
|
} else {
|
||||||
hoverText = "Unknown Private Network"
|
hoverText = 'Unknown Private Network'
|
||||||
iconName = 'unknown-private-network'
|
iconName = 'unknown-private-network'
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
@ -60,7 +60,7 @@ Network.prototype.render = function() {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}()
|
}(),
|
||||||
])
|
])
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,6 @@ const Identicon = require('./identicon')
|
|||||||
|
|
||||||
module.exports = Panel
|
module.exports = Panel
|
||||||
|
|
||||||
|
|
||||||
inherits(Panel, Component)
|
inherits(Panel, Component)
|
||||||
function Panel () {
|
function Panel () {
|
||||||
Component.call(this)
|
Component.call(this)
|
||||||
|
@ -10,7 +10,6 @@ const dataSize = require('../util').dataSize
|
|||||||
|
|
||||||
module.exports = PendingMsg
|
module.exports = PendingMsg
|
||||||
|
|
||||||
|
|
||||||
inherits(PendingMsg, Component)
|
inherits(PendingMsg, Component)
|
||||||
function PendingMsg () {
|
function PendingMsg () {
|
||||||
Component.call(this)
|
Component.call(this)
|
||||||
@ -34,7 +33,7 @@ PendingMsg.prototype.render = function() {
|
|||||||
style: {
|
style: {
|
||||||
fontWeight: 'bold',
|
fontWeight: 'bold',
|
||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
}
|
},
|
||||||
}, 'Sign Message'),
|
}, 'Sign Message'),
|
||||||
|
|
||||||
// account that will sign
|
// account that will sign
|
||||||
|
@ -10,7 +10,6 @@ const dataSize = require('../util').dataSize
|
|||||||
|
|
||||||
module.exports = PendingTx
|
module.exports = PendingTx
|
||||||
|
|
||||||
|
|
||||||
inherits(PendingTx, Component)
|
inherits(PendingTx, Component)
|
||||||
function PendingTx () {
|
function PendingTx () {
|
||||||
Component.call(this)
|
Component.call(this)
|
||||||
@ -34,7 +33,7 @@ PendingTx.prototype.render = function() {
|
|||||||
style: {
|
style: {
|
||||||
fontWeight: 'bold',
|
fontWeight: 'bold',
|
||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
}
|
},
|
||||||
}, 'Submit Transaction'),
|
}, 'Submit Transaction'),
|
||||||
|
|
||||||
// account that will sign
|
// account that will sign
|
||||||
|
@ -4,7 +4,6 @@ const inherits = require('util').inherits
|
|||||||
|
|
||||||
module.exports = NewComponent
|
module.exports = NewComponent
|
||||||
|
|
||||||
|
|
||||||
inherits(NewComponent, Component)
|
inherits(NewComponent, Component)
|
||||||
function NewComponent () {
|
function NewComponent () {
|
||||||
Component.call(this)
|
Component.call(this)
|
||||||
|
@ -6,7 +6,6 @@ const Identicon = require('./identicon')
|
|||||||
|
|
||||||
module.exports = TransactionIcon
|
module.exports = TransactionIcon
|
||||||
|
|
||||||
|
|
||||||
inherits(TransactionIcon, Component)
|
inherits(TransactionIcon, Component)
|
||||||
function TransactionIcon () {
|
function TransactionIcon () {
|
||||||
Component.call(this)
|
Component.call(this)
|
||||||
@ -19,7 +18,7 @@ TransactionIcon.prototype.render = function() {
|
|||||||
return h('i.fa.fa-exclamation-triangle.fa-lg.error', {
|
return h('i.fa.fa-exclamation-triangle.fa-lg.error', {
|
||||||
style: {
|
style: {
|
||||||
width: '24px',
|
width: '24px',
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -27,7 +26,7 @@ TransactionIcon.prototype.render = function() {
|
|||||||
return h('i.fa.fa-certificate.fa-lg', {
|
return h('i.fa.fa-certificate.fa-lg', {
|
||||||
style: {
|
style: {
|
||||||
width: '24px',
|
width: '24px',
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -40,7 +39,7 @@ TransactionIcon.prototype.render = function() {
|
|||||||
return h('i.fa.fa-file-text-o.fa-lg', {
|
return h('i.fa.fa-file-text-o.fa-lg', {
|
||||||
style: {
|
style: {
|
||||||
width: '24px',
|
width: '24px',
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,6 @@ const TransactionIcon = require('./transaction-list-item-icon')
|
|||||||
|
|
||||||
module.exports = TransactionListItem
|
module.exports = TransactionListItem
|
||||||
|
|
||||||
|
|
||||||
inherits(TransactionListItem, Component)
|
inherits(TransactionListItem, Component)
|
||||||
function TransactionListItem () {
|
function TransactionListItem () {
|
||||||
Component.call(this)
|
Component.call(this)
|
||||||
@ -107,7 +106,6 @@ function recipientField(txParams, transaction, isTx, isMsg) {
|
|||||||
message,
|
message,
|
||||||
failIfFailed(transaction),
|
failIfFailed(transaction),
|
||||||
])
|
])
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TransactionListItem.prototype.renderMessage = function () {
|
TransactionListItem.prototype.renderMessage = function () {
|
||||||
|
@ -64,7 +64,7 @@ TransactionList.prototype.render = function() {
|
|||||||
height: '100%',
|
height: '100%',
|
||||||
},
|
},
|
||||||
}, 'No transaction history...')]
|
}, 'No transaction history...')]
|
||||||
))
|
)),
|
||||||
])
|
])
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,6 @@ function ConfirmTxScreen() {
|
|||||||
Component.call(this)
|
Component.call(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ConfirmTxScreen.prototype.render = function () {
|
ConfirmTxScreen.prototype.render = function () {
|
||||||
var state = this.props
|
var state = this.props
|
||||||
|
|
||||||
@ -103,7 +102,6 @@ ConfirmTxScreen.prototype.render = function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function currentTxView (opts) {
|
function currentTxView (opts) {
|
||||||
|
|
||||||
if ('txParams' in opts.txData) {
|
if ('txParams' in opts.txData) {
|
||||||
// This is a pending transaction
|
// This is a pending transaction
|
||||||
return h(ConfirmTx, opts)
|
return h(ConfirmTx, opts)
|
||||||
|
@ -18,7 +18,6 @@ function ConfigScreen() {
|
|||||||
Component.call(this)
|
Component.call(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ConfigScreen.prototype.render = function () {
|
ConfigScreen.prototype.render = function () {
|
||||||
var state = this.props
|
var state = this.props
|
||||||
var rpc = state.rpc
|
var rpc = state.rpc
|
||||||
@ -32,7 +31,7 @@ ConfigScreen.prototype.render = function() {
|
|||||||
h('i.fa.fa-arrow-left.fa-lg.cursor-pointer', {
|
h('i.fa.fa-arrow-left.fa-lg.cursor-pointer', {
|
||||||
onClick: (event) => {
|
onClick: (event) => {
|
||||||
state.dispatch(actions.goHome())
|
state.dispatch(actions.goHome())
|
||||||
}
|
},
|
||||||
}),
|
}),
|
||||||
h('h2.page-subtitle', 'Configuration'),
|
h('h2.page-subtitle', 'Configuration'),
|
||||||
]),
|
]),
|
||||||
@ -42,7 +41,7 @@ ConfigScreen.prototype.render = function() {
|
|||||||
h('.flex-space-around', {
|
h('.flex-space-around', {
|
||||||
style: {
|
style: {
|
||||||
padding: '20px',
|
padding: '20px',
|
||||||
}
|
},
|
||||||
}, [
|
}, [
|
||||||
|
|
||||||
currentProviderDisplay(metamaskState),
|
currentProviderDisplay(metamaskState),
|
||||||
@ -62,7 +61,7 @@ ConfigScreen.prototype.render = function() {
|
|||||||
var newRpc = element.value
|
var newRpc = element.value
|
||||||
state.dispatch(actions.setRpcTarget(newRpc))
|
state.dispatch(actions.setRpcTarget(newRpc))
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
}),
|
}),
|
||||||
h('button', {
|
h('button', {
|
||||||
style: {
|
style: {
|
||||||
@ -73,8 +72,8 @@ ConfigScreen.prototype.render = function() {
|
|||||||
var element = document.querySelector('input#new_rpc')
|
var element = document.querySelector('input#new_rpc')
|
||||||
var newRpc = element.value
|
var newRpc = element.value
|
||||||
state.dispatch(actions.setRpcTarget(newRpc))
|
state.dispatch(actions.setRpcTarget(newRpc))
|
||||||
}
|
},
|
||||||
}, 'Save')
|
}, 'Save'),
|
||||||
]),
|
]),
|
||||||
|
|
||||||
h('div', [
|
h('div', [
|
||||||
@ -85,7 +84,7 @@ ConfigScreen.prototype.render = function() {
|
|||||||
onClick (event) {
|
onClick (event) {
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
state.dispatch(actions.setProviderType('mainnet'))
|
state.dispatch(actions.setProviderType('mainnet'))
|
||||||
}
|
},
|
||||||
}, 'Use Main Network'),
|
}, 'Use Main Network'),
|
||||||
]),
|
]),
|
||||||
|
|
||||||
@ -97,7 +96,7 @@ ConfigScreen.prototype.render = function() {
|
|||||||
onClick (event) {
|
onClick (event) {
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
state.dispatch(actions.setProviderType('testnet'))
|
state.dispatch(actions.setProviderType('testnet'))
|
||||||
}
|
},
|
||||||
}, 'Use Morden Test Network'),
|
}, 'Use Morden Test Network'),
|
||||||
]),
|
]),
|
||||||
|
|
||||||
@ -109,7 +108,7 @@ ConfigScreen.prototype.render = function() {
|
|||||||
onClick (event) {
|
onClick (event) {
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
state.dispatch(actions.setRpcTarget('http://localhost:8545/'))
|
state.dispatch(actions.setRpcTarget('http://localhost:8545/'))
|
||||||
}
|
},
|
||||||
}, 'Use http://localhost:8545'),
|
}, 'Use http://localhost:8545'),
|
||||||
]),
|
]),
|
||||||
|
|
||||||
@ -118,7 +117,7 @@ ConfigScreen.prototype.render = function() {
|
|||||||
h('div', {
|
h('div', {
|
||||||
style: {
|
style: {
|
||||||
marginTop: '20px',
|
marginTop: '20px',
|
||||||
}
|
},
|
||||||
}, [
|
}, [
|
||||||
h('button', {
|
h('button', {
|
||||||
style: {
|
style: {
|
||||||
@ -127,8 +126,8 @@ ConfigScreen.prototype.render = function() {
|
|||||||
onClick (event) {
|
onClick (event) {
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
state.dispatch(actions.revealSeedConfirmation())
|
state.dispatch(actions.revealSeedConfirmation())
|
||||||
}
|
},
|
||||||
}, 'Reveal Seed Words')
|
}, 'Reveal Seed Words'),
|
||||||
]),
|
]),
|
||||||
|
|
||||||
]),
|
]),
|
||||||
@ -160,6 +159,6 @@ function currentProviderDisplay(metamaskState) {
|
|||||||
|
|
||||||
return h('div', [
|
return h('div', [
|
||||||
h('span', {style: { fontWeight: 'bold', paddingRight: '10px'}}, title),
|
h('span', {style: { fontWeight: 'bold', paddingRight: '10px'}}, title),
|
||||||
h('span', value)
|
h('span', value),
|
||||||
])
|
])
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,6 @@ const actions = require('../actions')
|
|||||||
|
|
||||||
module.exports = connect(mapStateToProps)(CreateVaultCompleteScreen)
|
module.exports = connect(mapStateToProps)(CreateVaultCompleteScreen)
|
||||||
|
|
||||||
|
|
||||||
inherits(CreateVaultCompleteScreen, Component)
|
inherits(CreateVaultCompleteScreen, Component)
|
||||||
function CreateVaultCompleteScreen () {
|
function CreateVaultCompleteScreen () {
|
||||||
Component.call(this)
|
Component.call(this)
|
||||||
@ -50,7 +49,7 @@ CreateVaultCompleteScreen.prototype.render = function() {
|
|||||||
style: {
|
style: {
|
||||||
padding: '12px 20px 0px 20px',
|
padding: '12px 20px 0px 20px',
|
||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
}
|
},
|
||||||
}, 'These 12 words can restore all of your MetaMask accounts for this vault.\nSave them somewhere safe and secret.'),
|
}, 'These 12 words can restore all of your MetaMask accounts for this vault.\nSave them somewhere safe and secret.'),
|
||||||
|
|
||||||
h('textarea.twelve-word-phrase', {
|
h('textarea.twelve-word-phrase', {
|
||||||
|
@ -7,7 +7,6 @@ const actions = require('../actions')
|
|||||||
|
|
||||||
module.exports = connect(mapStateToProps)(CreateVaultScreen)
|
module.exports = connect(mapStateToProps)(CreateVaultScreen)
|
||||||
|
|
||||||
|
|
||||||
inherits(CreateVaultScreen, Component)
|
inherits(CreateVaultScreen, Component)
|
||||||
function CreateVaultScreen () {
|
function CreateVaultScreen () {
|
||||||
Component.call(this)
|
Component.call(this)
|
||||||
|
@ -18,7 +18,6 @@ function DisclaimerScreen() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
DisclaimerScreen.prototype.render = function () {
|
DisclaimerScreen.prototype.render = function () {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
h('.flex-column.flex-center.flex-grow', [
|
h('.flex-column.flex-center.flex-grow', [
|
||||||
|
|
||||||
@ -43,13 +42,13 @@ DisclaimerScreen.prototype.render = function() {
|
|||||||
padding: '6px',
|
padding: '6px',
|
||||||
width: '80%',
|
width: '80%',
|
||||||
overflowY: 'scroll',
|
overflowY: 'scroll',
|
||||||
}
|
},
|
||||||
}, disclaimer),
|
}, disclaimer),
|
||||||
|
|
||||||
h('button', {
|
h('button', {
|
||||||
style: { marginTop: '18px' },
|
style: { marginTop: '18px' },
|
||||||
onClick: () => this.props.dispatch(actions.agreeToDisclaimer())
|
onClick: () => this.props.dispatch(actions.agreeToDisclaimer()),
|
||||||
}, 'I Agree')
|
}, 'I Agree'),
|
||||||
])
|
])
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,6 @@ InitializeMenuScreen.prototype.render = function() {
|
|||||||
return this.renderMenu()
|
return this.renderMenu()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// InitializeMenuScreen.prototype.componentDidMount = function(){
|
// InitializeMenuScreen.prototype.componentDidMount = function(){
|
||||||
|
@ -6,7 +6,6 @@ const actions = require('../actions')
|
|||||||
|
|
||||||
module.exports = connect(mapStateToProps)(RestoreVaultScreen)
|
module.exports = connect(mapStateToProps)(RestoreVaultScreen)
|
||||||
|
|
||||||
|
|
||||||
inherits(RestoreVaultScreen, Component)
|
inherits(RestoreVaultScreen, Component)
|
||||||
function RestoreVaultScreen () {
|
function RestoreVaultScreen () {
|
||||||
Component.call(this)
|
Component.call(this)
|
||||||
@ -18,7 +17,6 @@ function mapStateToProps(state) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
RestoreVaultScreen.prototype.render = function () {
|
RestoreVaultScreen.prototype.render = function () {
|
||||||
var state = this.props
|
var state = this.props
|
||||||
return (
|
return (
|
||||||
@ -41,7 +39,7 @@ RestoreVaultScreen.prototype.render = function() {
|
|||||||
// wallet seed entry
|
// wallet seed entry
|
||||||
h('h3', 'Wallet Seed'),
|
h('h3', 'Wallet Seed'),
|
||||||
h('textarea.twelve-word-phrase.letter-spacey', {
|
h('textarea.twelve-word-phrase.letter-spacey', {
|
||||||
placeholder: 'Enter your secret twelve word phrase here to restore your vault.'
|
placeholder: 'Enter your secret twelve word phrase here to restore your vault.',
|
||||||
}),
|
}),
|
||||||
|
|
||||||
// password
|
// password
|
||||||
|
@ -18,7 +18,7 @@ function InfoScreen() {
|
|||||||
InfoScreen.prototype.render = function () {
|
InfoScreen.prototype.render = function () {
|
||||||
var state = this.props
|
var state = this.props
|
||||||
var rpc = state.rpc
|
var rpc = state.rpc
|
||||||
var manifest = chrome.runtime.getManifest();
|
var manifest = chrome.runtime.getManifest()
|
||||||
return (
|
return (
|
||||||
h('.flex-column.flex-grow', [
|
h('.flex-column.flex-grow', [
|
||||||
|
|
||||||
@ -27,7 +27,7 @@ InfoScreen.prototype.render = function() {
|
|||||||
h('i.fa.fa-arrow-left.fa-lg.cursor-pointer', {
|
h('i.fa.fa-arrow-left.fa-lg.cursor-pointer', {
|
||||||
onClick: (event) => {
|
onClick: (event) => {
|
||||||
state.dispatch(actions.goHome())
|
state.dispatch(actions.goHome())
|
||||||
}
|
},
|
||||||
}),
|
}),
|
||||||
h('h2.page-subtitle', 'Info'),
|
h('h2.page-subtitle', 'Info'),
|
||||||
]),
|
]),
|
||||||
@ -37,7 +37,7 @@ InfoScreen.prototype.render = function() {
|
|||||||
h('.flex-space-around', {
|
h('.flex-space-around', {
|
||||||
style: {
|
style: {
|
||||||
padding: '20px',
|
padding: '20px',
|
||||||
}
|
},
|
||||||
}, [
|
}, [
|
||||||
// current version number
|
// current version number
|
||||||
|
|
||||||
@ -46,7 +46,7 @@ InfoScreen.prototype.render = function() {
|
|||||||
h('div', {
|
h('div', {
|
||||||
style: {
|
style: {
|
||||||
marginBottom: '10px',
|
marginBottom: '10px',
|
||||||
}
|
},
|
||||||
}, `Version: ${manifest.version}`),
|
}, `Version: ${manifest.version}`),
|
||||||
]),
|
]),
|
||||||
|
|
||||||
@ -54,10 +54,9 @@ InfoScreen.prototype.render = function() {
|
|||||||
style: {
|
style: {
|
||||||
margin: '20px 0 ',
|
margin: '20px 0 ',
|
||||||
width: '7em',
|
width: '7em',
|
||||||
}
|
},
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
|
||||||
h('.info', {
|
h('.info', {
|
||||||
style: {
|
style: {
|
||||||
marginBottom: '20px',
|
marginBottom: '20px',
|
||||||
@ -79,14 +78,14 @@ InfoScreen.prototype.render = function() {
|
|||||||
onClick (event) { this.navigateTo(event.target.href) },
|
onClick (event) { this.navigateTo(event.target.href) },
|
||||||
}, [
|
}, [
|
||||||
h('img.icon-size', {
|
h('img.icon-size', {
|
||||||
src: manifest.icons[128]
|
src: manifest.icons[128],
|
||||||
}),
|
}),
|
||||||
h('div.info', {
|
h('div.info', {
|
||||||
style: {
|
style: {
|
||||||
fontWeight: 800,
|
fontWeight: 800,
|
||||||
}
|
},
|
||||||
},'Visit our web site')
|
}, 'Visit our web site'),
|
||||||
])
|
]),
|
||||||
]),
|
]),
|
||||||
h('div.fa.fa-slack', [
|
h('div.fa.fa-slack', [
|
||||||
h('a.info', {
|
h('a.info', {
|
||||||
@ -96,7 +95,6 @@ InfoScreen.prototype.render = function() {
|
|||||||
}, 'Join the conversation on Slack'),
|
}, 'Join the conversation on Slack'),
|
||||||
]),
|
]),
|
||||||
|
|
||||||
|
|
||||||
h('div.fa.fa-twitter', [
|
h('div.fa.fa-twitter', [
|
||||||
h('a.info', {
|
h('a.info', {
|
||||||
href: 'https://twitter.com/metamask_io',
|
href: 'https://twitter.com/metamask_io',
|
||||||
@ -124,9 +122,8 @@ InfoScreen.prototype.render = function() {
|
|||||||
]),
|
]),
|
||||||
])
|
])
|
||||||
)
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
InfoScreen.prototype.navigateTo = function (url) {
|
InfoScreen.prototype.navigateTo = function (url) {
|
||||||
chrome.tabs.create({ url });
|
chrome.tabs.create({ url })
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ LoadingIndicator.prototype.render = function() {
|
|||||||
height: '100%',
|
height: '100%',
|
||||||
width: '100%',
|
width: '100%',
|
||||||
background: 'rgba(255, 255, 255, 0.5)',
|
background: 'rgba(255, 255, 255, 0.5)',
|
||||||
}
|
},
|
||||||
}, [
|
}, [
|
||||||
h('img', {
|
h('img', {
|
||||||
src: 'images/loading.svg',
|
src: 'images/loading.svg',
|
||||||
|
@ -7,7 +7,6 @@ const actions = require('../actions')
|
|||||||
|
|
||||||
module.exports = connect(mapStateToProps)(RevealSeedConfirmatoin)
|
module.exports = connect(mapStateToProps)(RevealSeedConfirmatoin)
|
||||||
|
|
||||||
|
|
||||||
inherits(RevealSeedConfirmatoin, Component)
|
inherits(RevealSeedConfirmatoin, Component)
|
||||||
function RevealSeedConfirmatoin () {
|
function RevealSeedConfirmatoin () {
|
||||||
Component.call(this)
|
Component.call(this)
|
||||||
@ -48,7 +47,7 @@ RevealSeedConfirmatoin.prototype.render = function() {
|
|||||||
flexDirection: 'column',
|
flexDirection: 'column',
|
||||||
padding: '20px',
|
padding: '20px',
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
}
|
},
|
||||||
}, [
|
}, [
|
||||||
|
|
||||||
h('h4', 'Do not recover your seed words in a public place! These words can be used to steal all your accounts.'),
|
h('h4', 'Do not recover your seed words in a public place! These words can be used to steal all your accounts.'),
|
||||||
@ -68,8 +67,8 @@ RevealSeedConfirmatoin.prototype.render = function() {
|
|||||||
h(`h4${state && state.confirmationWrong ? '.error' : ''}`, {
|
h(`h4${state && state.confirmationWrong ? '.error' : ''}`, {
|
||||||
style: {
|
style: {
|
||||||
marginTop: '12px',
|
marginTop: '12px',
|
||||||
}
|
},
|
||||||
}, `Enter the phrase "I understand" to proceed.`),
|
}, 'Enter the phrase "I understand" to proceed.'),
|
||||||
|
|
||||||
// confirm confirmation
|
// confirm confirmation
|
||||||
h('input.large-input.letter-spacey', {
|
h('input.large-input.letter-spacey', {
|
||||||
@ -105,7 +104,7 @@ RevealSeedConfirmatoin.prototype.render = function() {
|
|||||||
h('span.error', {
|
h('span.error', {
|
||||||
style: {
|
style: {
|
||||||
margin: '20px',
|
margin: '20px',
|
||||||
}
|
},
|
||||||
}, props.warning.split('-'))
|
}, props.warning.split('-'))
|
||||||
),
|
),
|
||||||
|
|
||||||
|
@ -12,7 +12,6 @@ const reduceApp = require('./reducers/app')
|
|||||||
module.exports = rootReducer
|
module.exports = rootReducer
|
||||||
|
|
||||||
function rootReducer (state, action) {
|
function rootReducer (state, action) {
|
||||||
|
|
||||||
// clone
|
// clone
|
||||||
state = extend(state)
|
state = extend(state)
|
||||||
|
|
||||||
@ -34,8 +33,6 @@ function rootReducer(state, action) {
|
|||||||
|
|
||||||
state.appState = reduceApp(state, action)
|
state.appState = reduceApp(state, action)
|
||||||
|
|
||||||
|
|
||||||
return state
|
return state
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,6 @@ const txHelper = require('../../lib/tx-helper')
|
|||||||
module.exports = reduceApp
|
module.exports = reduceApp
|
||||||
|
|
||||||
function reduceApp (state, action) {
|
function reduceApp (state, action) {
|
||||||
|
|
||||||
// clone and defaults
|
// clone and defaults
|
||||||
const selectedAccount = state.metamask.selectedAccount
|
const selectedAccount = state.metamask.selectedAccount
|
||||||
const pendingTxs = hasPendingTxs(state)
|
const pendingTxs = hasPendingTxs(state)
|
||||||
@ -156,7 +155,6 @@ function reduceApp(state, action) {
|
|||||||
warning: null,
|
warning: null,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
// accounts
|
// accounts
|
||||||
|
|
||||||
case actions.SET_SELECTED_ACCOUNT:
|
case actions.SET_SELECTED_ACCOUNT:
|
||||||
@ -281,7 +279,7 @@ function reduceApp(state, action) {
|
|||||||
name: 'confTx',
|
name: 'confTx',
|
||||||
context: ++appState.currentView.context,
|
context: ++appState.currentView.context,
|
||||||
warning: null,
|
warning: null,
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
case actions.VIEW_PENDING_TX:
|
case actions.VIEW_PENDING_TX:
|
||||||
@ -292,7 +290,7 @@ function reduceApp(state, action) {
|
|||||||
name: 'confTx',
|
name: 'confTx',
|
||||||
context,
|
context,
|
||||||
warning: null,
|
warning: null,
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
case actions.PREVIOUS_TX:
|
case actions.PREVIOUS_TX:
|
||||||
@ -302,7 +300,7 @@ function reduceApp(state, action) {
|
|||||||
name: 'confTx',
|
name: 'confTx',
|
||||||
context: --appState.currentView.context,
|
context: --appState.currentView.context,
|
||||||
warning: null,
|
warning: null,
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
case actions.TRANSACTION_ERROR:
|
case actions.TRANSACTION_ERROR:
|
||||||
@ -315,7 +313,7 @@ function reduceApp(state, action) {
|
|||||||
|
|
||||||
case actions.UNLOCK_FAILED:
|
case actions.UNLOCK_FAILED:
|
||||||
return extend(appState, {
|
return extend(appState, {
|
||||||
warning: 'Incorrect password. Try again.'
|
warning: 'Incorrect password. Try again.',
|
||||||
})
|
})
|
||||||
|
|
||||||
case actions.SHOW_LOADING:
|
case actions.SHOW_LOADING:
|
||||||
|
@ -4,7 +4,6 @@ const actions = require('../actions')
|
|||||||
module.exports = reduceIdentities
|
module.exports = reduceIdentities
|
||||||
|
|
||||||
function reduceIdentities (state, action) {
|
function reduceIdentities (state, action) {
|
||||||
|
|
||||||
// clone + defaults
|
// clone + defaults
|
||||||
var idState = extend({
|
var idState = extend({
|
||||||
|
|
||||||
@ -14,5 +13,4 @@ function reduceIdentities(state, action) {
|
|||||||
default:
|
default:
|
||||||
return idState
|
return idState
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,6 @@ const actions = require('../actions')
|
|||||||
module.exports = reduceMetamask
|
module.exports = reduceMetamask
|
||||||
|
|
||||||
function reduceMetamask (state, action) {
|
function reduceMetamask (state, action) {
|
||||||
|
|
||||||
// clone + defaults
|
// clone + defaults
|
||||||
var metamaskState = extend({
|
var metamaskState = extend({
|
||||||
isInitialized: false,
|
isInitialized: false,
|
||||||
|
@ -7,7 +7,6 @@ const App = require('./app')
|
|||||||
|
|
||||||
module.exports = Root
|
module.exports = Root
|
||||||
|
|
||||||
|
|
||||||
inherits(Root, Component)
|
inherits(Root, Component)
|
||||||
function Root () { Component.call(this) }
|
function Root () { Component.call(this) }
|
||||||
|
|
||||||
@ -17,7 +16,7 @@ Root.prototype.render = function() {
|
|||||||
h(Provider, {
|
h(Provider, {
|
||||||
store: this.props.store,
|
store: this.props.store,
|
||||||
}, [
|
}, [
|
||||||
h(App)
|
h(App),
|
||||||
])
|
])
|
||||||
|
|
||||||
)
|
)
|
||||||
|
@ -111,7 +111,7 @@ SendTransactionScreen.prototype.render = function() {
|
|||||||
// h('div', formatBalance(account && account.balance)),
|
// h('div', formatBalance(account && account.balance)),
|
||||||
h(EtherBalance, {
|
h(EtherBalance, {
|
||||||
value: account && account.balance,
|
value: account && account.balance,
|
||||||
})
|
}),
|
||||||
|
|
||||||
]),
|
]),
|
||||||
|
|
||||||
@ -140,7 +140,7 @@ SendTransactionScreen.prototype.render = function() {
|
|||||||
h('input.large-input', {
|
h('input.large-input', {
|
||||||
name: 'address',
|
name: 'address',
|
||||||
placeholder: 'Recipient Address',
|
placeholder: 'Recipient Address',
|
||||||
})
|
}),
|
||||||
]),
|
]),
|
||||||
|
|
||||||
// 'amount' and send button
|
// 'amount' and send button
|
||||||
@ -160,7 +160,7 @@ SendTransactionScreen.prototype.render = function() {
|
|||||||
style: {
|
style: {
|
||||||
textTransform: 'uppercase',
|
textTransform: 'uppercase',
|
||||||
},
|
},
|
||||||
}, 'Send')
|
}, 'Send'),
|
||||||
|
|
||||||
]),
|
]),
|
||||||
|
|
||||||
@ -187,7 +187,7 @@ SendTransactionScreen.prototype.render = function() {
|
|||||||
style: {
|
style: {
|
||||||
width: '100%',
|
width: '100%',
|
||||||
resize: 'none',
|
resize: 'none',
|
||||||
}
|
},
|
||||||
}),
|
}),
|
||||||
]),
|
]),
|
||||||
|
|
||||||
@ -207,7 +207,6 @@ SendTransactionScreen.prototype.back = function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
SendTransactionScreen.prototype.onSubmit = function () {
|
SendTransactionScreen.prototype.onSubmit = function () {
|
||||||
|
|
||||||
const recipient = document.querySelector('input[name="address"]').value
|
const recipient = document.querySelector('input[name="address"]').value
|
||||||
const input = document.querySelector('input[name="amount"]').value
|
const input = document.querySelector('input[name="amount"]').value
|
||||||
const value = util.normalizeEthStringToWei(input)
|
const value = util.normalizeEthStringToWei(input)
|
||||||
|
@ -20,7 +20,6 @@ function AppSettingsPage() {
|
|||||||
Component.call(this)
|
Component.call(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
AppSettingsPage.prototype.render = function () {
|
AppSettingsPage.prototype.render = function () {
|
||||||
var state = this.props
|
var state = this.props
|
||||||
var identity = state.identities[state.address]
|
var identity = state.identities[state.address]
|
||||||
@ -62,7 +61,6 @@ AppSettingsPage.prototype.onKeyPress = function(event) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
AppSettingsPage.prototype.navigateToAccounts = function (event) {
|
AppSettingsPage.prototype.navigateToAccounts = function (event) {
|
||||||
event.stopPropagation()
|
event.stopPropagation()
|
||||||
this.props.dispatch(actions.showAccountsPage())
|
this.props.dispatch(actions.showAccountsPage())
|
||||||
|
@ -6,7 +6,6 @@ const rootReducer = require('./reducers')
|
|||||||
|
|
||||||
module.exports = configureStore
|
module.exports = configureStore
|
||||||
|
|
||||||
|
|
||||||
const loggerMiddleware = createLogger()
|
const loggerMiddleware = createLogger()
|
||||||
|
|
||||||
const createStoreWithMiddleware = applyMiddleware(
|
const createStoreWithMiddleware = applyMiddleware(
|
||||||
|
@ -22,9 +22,9 @@ COMPONENTNAME.prototype.render = function() {
|
|||||||
h('div', {
|
h('div', {
|
||||||
style: {
|
style: {
|
||||||
background: 'blue',
|
background: 'blue',
|
||||||
}
|
},
|
||||||
}, [
|
}, [
|
||||||
'Hello, world!'
|
'Hello, world!',
|
||||||
])
|
])
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,6 @@ const EventEmitter = require('events').EventEmitter
|
|||||||
|
|
||||||
module.exports = connect(mapStateToProps)(UnlockScreen)
|
module.exports = connect(mapStateToProps)(UnlockScreen)
|
||||||
|
|
||||||
|
|
||||||
inherits(UnlockScreen, Component)
|
inherits(UnlockScreen, Component)
|
||||||
function UnlockScreen () {
|
function UnlockScreen () {
|
||||||
Component.call(this)
|
Component.call(this)
|
||||||
@ -55,7 +54,7 @@ UnlockScreen.prototype.render = function() {
|
|||||||
h('.error', {
|
h('.error', {
|
||||||
style: {
|
style: {
|
||||||
display: warning ? 'block' : 'none',
|
display: warning ? 'block' : 'none',
|
||||||
}
|
},
|
||||||
}, warning),
|
}, warning),
|
||||||
|
|
||||||
h('button.primary.cursor-pointer', {
|
h('button.primary.cursor-pointer', {
|
||||||
|
@ -37,7 +37,6 @@ module.exports = {
|
|||||||
bnTable: bnTable,
|
bnTable: bnTable,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function valuesFor (obj) {
|
function valuesFor (obj) {
|
||||||
if (!obj) return []
|
if (!obj) return []
|
||||||
return Object.keys(obj)
|
return Object.keys(obj)
|
||||||
@ -103,7 +102,7 @@ function formatBalance(balance, decimalsToKeep) {
|
|||||||
var parsed = parseBalance(balance)
|
var parsed = parseBalance(balance)
|
||||||
var beforeDecimal = parsed[0]
|
var beforeDecimal = parsed[0]
|
||||||
var afterDecimal = parsed[1]
|
var afterDecimal = parsed[1]
|
||||||
var formatted = "None"
|
var formatted = 'None'
|
||||||
if (decimalsToKeep === undefined) {
|
if (decimalsToKeep === undefined) {
|
||||||
if (beforeDecimal === '0') {
|
if (beforeDecimal === '0') {
|
||||||
if (afterDecimal !== '0') {
|
if (afterDecimal !== '0') {
|
||||||
@ -112,11 +111,11 @@ function formatBalance(balance, decimalsToKeep) {
|
|||||||
formatted = '0.' + afterDecimal + ' ETH'
|
formatted = '0.' + afterDecimal + ' ETH'
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
formatted = beforeDecimal + "." + afterDecimal.slice(0,3) + ' ETH'
|
formatted = beforeDecimal + '.' + afterDecimal.slice(0, 3) + ' ETH'
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
afterDecimal += Array(decimalsToKeep).join("0")
|
afterDecimal += Array(decimalsToKeep).join('0')
|
||||||
formatted = beforeDecimal + "." + afterDecimal.slice(0,decimalsToKeep) + ' ETH'
|
formatted = beforeDecimal + '.' + afterDecimal.slice(0, decimalsToKeep) + ' ETH'
|
||||||
}
|
}
|
||||||
return formatted
|
return formatted
|
||||||
}
|
}
|
||||||
@ -162,8 +161,8 @@ function readableDate(ms) {
|
|||||||
var day = date.getDate()
|
var day = date.getDate()
|
||||||
var year = date.getFullYear()
|
var year = date.getFullYear()
|
||||||
var hours = date.getHours()
|
var hours = date.getHours()
|
||||||
var minutes = "0" + date.getMinutes()
|
var minutes = '0' + date.getMinutes()
|
||||||
var seconds = "0" + date.getSeconds()
|
var seconds = '0' + date.getSeconds()
|
||||||
|
|
||||||
var date = `${month}/${day}/${year}`
|
var date = `${month}/${day}/${year}`
|
||||||
var time = `${hours}:${minutes.substr(-2)}:${seconds.substr(-2)}`
|
var time = `${hours}:${minutes.substr(-2)}:${seconds.substr(-2)}`
|
||||||
|
@ -26,7 +26,7 @@ var identities = {
|
|||||||
address: '0x333462427bcc9133bb46e88bcbe39cd7ef0e7333',
|
address: '0x333462427bcc9133bb46e88bcbe39cd7ef0e7333',
|
||||||
balance: 0.000001,
|
balance: 0.000001,
|
||||||
txCount: 1,
|
txCount: 1,
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
var unconfTxs = {}
|
var unconfTxs = {}
|
||||||
@ -108,7 +108,7 @@ injectCss(css)
|
|||||||
|
|
||||||
var app = MetaMaskUi({
|
var app = MetaMaskUi({
|
||||||
container: container,
|
container: container,
|
||||||
accountManager: accountManager
|
accountManager: accountManager,
|
||||||
})
|
})
|
||||||
|
|
||||||
// util
|
// util
|
||||||
|
@ -9,7 +9,6 @@ const configureStore = require('./app/store')
|
|||||||
module.exports = launchApp
|
module.exports = launchApp
|
||||||
|
|
||||||
function launchApp (opts) {
|
function launchApp (opts) {
|
||||||
|
|
||||||
var accountManager = opts.accountManager
|
var accountManager = opts.accountManager
|
||||||
actions._setAccountManager(accountManager)
|
actions._setAccountManager(accountManager)
|
||||||
|
|
||||||
@ -18,11 +17,9 @@ function launchApp(opts) {
|
|||||||
if (err) throw err
|
if (err) throw err
|
||||||
startApp(metamaskState, accountManager, opts)
|
startApp(metamaskState, accountManager, opts)
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function startApp (metamaskState, accountManager, opts) {
|
function startApp (metamaskState, accountManager, opts) {
|
||||||
|
|
||||||
// parse opts
|
// parse opts
|
||||||
var store = configureStore({
|
var store = configureStore({
|
||||||
|
|
||||||
@ -59,5 +56,4 @@ function startApp(metamaskState, accountManager, opts){
|
|||||||
store: store,
|
store: store,
|
||||||
}
|
}
|
||||||
), opts.container)
|
), opts.container)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,6 @@ IconFactory.prototype.cacheIcon = function(address, diameter, icon) {
|
|||||||
var sizeCache = {}
|
var sizeCache = {}
|
||||||
sizeCache[diameter] = icon
|
sizeCache[diameter] = icon
|
||||||
return this.cache[address] = sizeCache
|
return this.cache[address] = sizeCache
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
return this.cache[address][diameter] = icon
|
return this.cache[address][diameter] = icon
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user