From aac810b1eb3414c907010c30537b7014f303d20f Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Thu, 21 Jul 2016 08:47:03 -0700 Subject: Progress on config manager. Plus tests. --- app/scripts/lib/config-manager.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'app') diff --git a/app/scripts/lib/config-manager.js b/app/scripts/lib/config-manager.js index caaae8a75..a5b319325 100644 --- a/app/scripts/lib/config-manager.js +++ b/app/scripts/lib/config-manager.js @@ -1,6 +1,7 @@ const Migrator = require('pojo-migrator') const MetamaskConfig = require('../config.js') const migrations = require('./migrations') +const rp = require('request-promise') const TESTNET_RPC = MetamaskConfig.network.testnet const MAINNET_RPC = MetamaskConfig.network.mainnet @@ -270,3 +271,29 @@ ConfigManager.prototype.getConfirmed = function () { return ('isConfirmed' in data) && data.isConfirmed } +ConfigManager.prototype.setCurrentFiat = function (currency) { + var data = this.getData() + data.fiatCurrency = currency + this.setData(data) +} + +ConfigManager.prototype.getCurrentFiat = function () { + var data = this.getData() + return ('fiatCurrency' in data) && data.fiatCurrency +} + +ConfigManager.prototype.setConversionRate = function () { + var data = this.getData() + return rp(`https://www.cryptonator.com/api/ticker/eth-${data.fiatCurrency}`) + .then(function (response) { + data.conversionRate = Number(JSON.parse(response).ticker.price) + this.setData(data) + }.bind(this)).catch(function (err) { + console.log('Error in conversion.', err) + }) +} + +ConfigManager.prototype.getConversionRate = function () { + var data = this.getData() + return ('conversionRate' in data) && data.conversionRate +} -- cgit v1.2.3 From 491b9cddc5fe1a7d0899d29c9a53aa71f04b9b28 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Thu, 21 Jul 2016 09:30:58 -0700 Subject: Add fiat actions to metamask controllere and actions. --- app/scripts/metamask-controller.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'app') diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 63970799d..bcf5203fe 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -39,6 +39,7 @@ module.exports = class MetamaskController { setProviderType: this.setProviderType.bind(this), useEtherscanProvider: this.useEtherscanProvider.bind(this), agreeToDisclaimer: this.agreeToDisclaimer.bind(this), + setCurrentFiat: this.setCurrentFiat.bind(this), // forward directly to idStore createNewVault: idStore.createNewVault.bind(idStore), recoverFromSeed: idStore.recoverFromSeed.bind(idStore), @@ -236,6 +237,15 @@ module.exports = class MetamaskController { } } + setCurrentFiat (fiat, cb) { + try { + this.configManager.setCurrentFiat(fiat) + this.configManager.setConversionRate() + } catch (e) { + cb(e) + } + } + // called from popup setRpcTarget (rpcTarget) { this.configManager.setRpcTarget(rpcTarget) -- cgit v1.2.3 From 4a9d5b1c258912acedd6f1e89fb632526d9c910b Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Thu, 21 Jul 2016 10:15:34 -0700 Subject: Add data field to pass up parameters up to reducer. --- app/scripts/lib/idStore.js | 4 +++- app/scripts/metamask-controller.js | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/scripts/lib/idStore.js b/app/scripts/lib/idStore.js index 2c8e9108b..94aaad1d1 100644 --- a/app/scripts/lib/idStore.js +++ b/app/scripts/lib/idStore.js @@ -99,6 +99,8 @@ IdentityStore.prototype.getState = function () { unconfMsgs: messageManager.unconfirmedMsgs(), messages: messageManager.getMsgList(), selectedAddress: configManager.getSelectedAccount(), + currentFiat: configManager.getCurrentFiat(), + currentConversion: configManager.getConversionRate(), })) } @@ -199,7 +201,7 @@ IdentityStore.prototype.addUnconfirmedTransaction = function (txParams, onTxDone time: time, status: 'unconfirmed', } - + console.log('addUnconfirmedTransaction:', txData) // keep the onTxDoneCb around for after approval/denial (requires user interaction) diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index bcf5203fe..1b3b69932 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -241,8 +241,13 @@ module.exports = class MetamaskController { try { this.configManager.setCurrentFiat(fiat) this.configManager.setConversionRate() + const data = { + conversionRate: this.configManager.getConversionRate, + currentFiat: this.configManager.getCurrentFiat, + } + cb(data) } catch (e) { - cb(e) + cb(null,e) } } -- cgit v1.2.3 From 66941f0808cd8052bd5a90b10900e49e071ba727 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Thu, 21 Jul 2016 13:33:22 -0700 Subject: Provide date access. --- app/scripts/lib/config-manager.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/scripts/lib/config-manager.js b/app/scripts/lib/config-manager.js index a5b319325..cd0d37e98 100644 --- a/app/scripts/lib/config-manager.js +++ b/app/scripts/lib/config-manager.js @@ -286,7 +286,9 @@ ConfigManager.prototype.setConversionRate = function () { var data = this.getData() return rp(`https://www.cryptonator.com/api/ticker/eth-${data.fiatCurrency}`) .then(function (response) { - data.conversionRate = Number(JSON.parse(response).ticker.price) + const parsedResponse = JSON.parse(response) + data.conversionRate = Number(parsedResponse.ticker.price) + data.conversionLastUpdated = new Date(parsedResponse.timestamp).toString() this.setData(data) }.bind(this)).catch(function (err) { console.log('Error in conversion.', err) @@ -297,3 +299,8 @@ ConfigManager.prototype.getConversionRate = function () { var data = this.getData() return ('conversionRate' in data) && data.conversionRate } + +ConfigManager.prototype.getConversionLastUpdated = function () { + var data = this.getData() + return ('conversionLastUpdated' in data) && data.conversionLastUpdated +} -- cgit v1.2.3 From 716e65424d2ba490a384bfc1f0591685eb2867fa Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Thu, 21 Jul 2016 14:08:26 -0700 Subject: Add date access throughout the data flow. --- app/scripts/lib/config-manager.js | 6 +++--- app/scripts/lib/idStore.js | 3 ++- app/scripts/metamask-controller.js | 1 + 3 files changed, 6 insertions(+), 4 deletions(-) (limited to 'app') diff --git a/app/scripts/lib/config-manager.js b/app/scripts/lib/config-manager.js index cd0d37e98..03f8c054d 100644 --- a/app/scripts/lib/config-manager.js +++ b/app/scripts/lib/config-manager.js @@ -288,7 +288,7 @@ ConfigManager.prototype.setConversionRate = function () { .then(function (response) { const parsedResponse = JSON.parse(response) data.conversionRate = Number(parsedResponse.ticker.price) - data.conversionLastUpdated = new Date(parsedResponse.timestamp).toString() + data.conversionDate = new Date(parsedResponse.timestamp).toString() this.setData(data) }.bind(this)).catch(function (err) { console.log('Error in conversion.', err) @@ -300,7 +300,7 @@ ConfigManager.prototype.getConversionRate = function () { return ('conversionRate' in data) && data.conversionRate } -ConfigManager.prototype.getConversionLastUpdated = function () { +ConfigManager.prototype.getConversionDate = function () { var data = this.getData() - return ('conversionLastUpdated' in data) && data.conversionLastUpdated + return ('conversionDate' in data) && data.conversionDate } diff --git a/app/scripts/lib/idStore.js b/app/scripts/lib/idStore.js index 94aaad1d1..b6c136b8f 100644 --- a/app/scripts/lib/idStore.js +++ b/app/scripts/lib/idStore.js @@ -100,7 +100,8 @@ IdentityStore.prototype.getState = function () { messages: messageManager.getMsgList(), selectedAddress: configManager.getSelectedAccount(), currentFiat: configManager.getCurrentFiat(), - currentConversion: configManager.getConversionRate(), + conversionRate: configManager.getConversionRate(), + conversionDate: configManager.getConversionDate(), })) } diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 7bf8fd5ea..99769fa3c 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -245,6 +245,7 @@ module.exports = class MetamaskController { const data = { conversionRate: this.configManager.getConversionRate, currentFiat: this.configManager.getCurrentFiat, + conversionDate: this.configManager.getConversionDate, } cb(data) } catch (e) { -- cgit v1.2.3 From a612fcee64422ca43c470d7832a263f5e490611d Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Thu, 21 Jul 2016 16:44:50 -0700 Subject: Change function names. Add interval polling for api. Refactor functions. --- app/scripts/lib/config-manager.js | 25 ++++++++++++++++++------- app/scripts/metamask-controller.js | 14 +++++++++++++- 2 files changed, 31 insertions(+), 8 deletions(-) (limited to 'app') diff --git a/app/scripts/lib/config-manager.js b/app/scripts/lib/config-manager.js index 03f8c054d..14caa80c8 100644 --- a/app/scripts/lib/config-manager.js +++ b/app/scripts/lib/config-manager.js @@ -282,19 +282,30 @@ ConfigManager.prototype.getCurrentFiat = function () { return ('fiatCurrency' in data) && data.fiatCurrency } -ConfigManager.prototype.setConversionRate = function () { +ConfigManager.prototype.updateConversionRate = function () { var data = this.getData() return rp(`https://www.cryptonator.com/api/ticker/eth-${data.fiatCurrency}`) - .then(function (response) { + .then((response) => { const parsedResponse = JSON.parse(response) - data.conversionRate = Number(parsedResponse.ticker.price) - data.conversionDate = new Date(parsedResponse.timestamp).toString() - this.setData(data) - }.bind(this)).catch(function (err) { - console.log('Error in conversion.', err) + this.setConversionPrice(parsedResponse.ticker.price) + this.setConversionDate(parsedResponse.timestamp) + }).catch((err) => { + console.error('Error in conversion.', err) }) } +ConfigManager.prototype.setConversionPrice = function(price) { + var data = this.getData() + data.conversionRate = Number(parsedResponse.ticker.price) + this.setData(data) +} + +ConfigManager.prototype.setConversionDate = function (datestring) { + var data = this.getData() + data.conversionDate = datestring + this.setData(data) +} + ConfigManager.prototype.getConversionRate = function () { var data = this.getData() return ('conversionRate' in data) && data.conversionRate diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 99769fa3c..e121fad6a 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -21,6 +21,7 @@ module.exports = class MetamaskController { this.idStore.setStore(this.ethStore) this.messageManager = messageManager this.publicConfigStore = this.initPublicConfigStore() + this.scheduleConversionInterval() } getState () { @@ -241,7 +242,8 @@ module.exports = class MetamaskController { setCurrentFiat (fiat, cb) { try { this.configManager.setCurrentFiat(fiat) - this.configManager.setConversionRate() + this.configManager.updateConversionRate() + this.scheduleConversionInterval() const data = { conversionRate: this.configManager.getConversionRate, currentFiat: this.configManager.getCurrentFiat, @@ -253,6 +255,16 @@ module.exports = class MetamaskController { } } + scheduleConversionInterval () { + if (this.conversionInterval) { + clearInterval(this.conversionInterval) + } + this.conversionInterval = setInterval(() => { + console.log("Updated currency!") + this.configManager.updateConversionRate() + }, 1000) + } + // called from popup setRpcTarget (rpcTarget) { this.configManager.setRpcTarget(rpcTarget) -- cgit v1.2.3 From 22528002e1edef84ade67d5bc30b2580e6542c05 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Fri, 22 Jul 2016 10:15:39 -0700 Subject: Linting! --- app/scripts/lib/config-manager.js | 2 +- app/scripts/metamask-controller.js | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'app') diff --git a/app/scripts/lib/config-manager.js b/app/scripts/lib/config-manager.js index 14caa80c8..e0f389ed4 100644 --- a/app/scripts/lib/config-manager.js +++ b/app/scripts/lib/config-manager.js @@ -296,7 +296,7 @@ ConfigManager.prototype.updateConversionRate = function () { ConfigManager.prototype.setConversionPrice = function(price) { var data = this.getData() - data.conversionRate = Number(parsedResponse.ticker.price) + data.conversionRate = Number(price) this.setData(data) } diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index e121fad6a..0537bda97 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -251,7 +251,7 @@ module.exports = class MetamaskController { } cb(data) } catch (e) { - cb(null,e) + cb(null, e) } } @@ -260,7 +260,9 @@ module.exports = class MetamaskController { clearInterval(this.conversionInterval) } this.conversionInterval = setInterval(() => { - console.log("Updated currency!") + console.log('=================') + console.log('Updated currency!') + console.log('=================') this.configManager.updateConversionRate() }, 1000) } -- cgit v1.2.3 From 260de6532c50dceebee93acab70a3319afdb16fb Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Fri, 5 Aug 2016 12:18:44 -0700 Subject: Get fiat numbers rendering on tooltip. Need to find way to create line breaks. --- app/scripts/lib/config-manager.js | 6 ------ 1 file changed, 6 deletions(-) (limited to 'app') diff --git a/app/scripts/lib/config-manager.js b/app/scripts/lib/config-manager.js index 9c37a2c6f..49eb7be4f 100644 --- a/app/scripts/lib/config-manager.js +++ b/app/scripts/lib/config-manager.js @@ -293,12 +293,6 @@ ConfigManager.prototype.updateConversionRate = function () { const parsedResponse = JSON.parse(response) this.setConversionPrice(parsedResponse.ticker.price) this.setConversionDate(parsedResponse.timestamp) - console.log('=================') - console.log('Updated currency!') - console.log('=================') - console.log(this.getConversionRate()) - console.log(this.getCurrentFiat()) - console.log(parsedResponse) }).catch((err) => { console.error('Error in conversion.', err) }) -- cgit v1.2.3 From 8acb3e6007ee62e4f7f1795478de60b614947d96 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Tue, 9 Aug 2016 09:48:08 -0700 Subject: Enable full listing of supported currencies by Cryptonator. --- app/currencies.json | 1 + 1 file changed, 1 insertion(+) create mode 100644 app/currencies.json (limited to 'app') diff --git a/app/currencies.json b/app/currencies.json new file mode 100644 index 000000000..07889798b --- /dev/null +++ b/app/currencies.json @@ -0,0 +1 @@ +{"rows":[{"code":"007","name":"007","statuses":["primary"]},{"code":"1337","name":"1337","statuses":["primary"]},{"code":"1CR","name":"1CR","statuses":["primary"]},{"code":"256","name":"256","statuses":["primary"]},{"code":"2FLAV","name":"2FLAV","statuses":["primary"]},{"code":"2GIVE","name":"2GIVE","statuses":["primary"]},{"code":"404","name":"404","statuses":["primary"]},{"code":"611","name":"611","statuses":["primary"]},{"code":"888","name":"888","statuses":["primary"]},{"code":"8BIT","name":"8Bit","statuses":["primary"]},{"code":"ACLR","name":"ACLR","statuses":["primary"]},{"code":"ACOIN","name":"ACOIN","statuses":["primary"]},{"code":"ACP","name":"ACP","statuses":["primary"]},{"code":"ADC","name":"ADC","statuses":["primary"]},{"code":"ADZ","name":"Adzcoin","statuses":["primary"]},{"code":"AEC","name":"AEC","statuses":["primary"]},{"code":"AEON","name":"Aeon","statuses":["primary"]},{"code":"AGRS","name":"Agoras Tokens","statuses":["primary"]},{"code":"AIB","name":"AIB","statuses":["primary"]},{"code":"ADN","name":"Aiden","statuses":["primary"]},{"code":"AIR","name":"AIR","statuses":["primary"]},{"code":"ALC","name":"ALC","statuses":["primary"]},{"code":"ALTC","name":"ALTC","statuses":["primary"]},{"code":"AM","name":"AM","statuses":["primary"]},{"code":"AMBER","name":"AMBER","statuses":["primary"]},{"code":"AMS","name":"AMS","statuses":["primary"]},{"code":"ANAL","name":"ANAL","statuses":["primary"]},{"code":"AND","name":"AND","statuses":["primary"]},{"code":"ANI","name":"ANI","statuses":["primary"]},{"code":"ANC","name":"Anoncoin","statuses":["primary"]},{"code":"ANTI","name":"AntiBitcoin","statuses":["primary"]},{"code":"APEX","name":"APEX","statuses":["primary"]},{"code":"APC","name":"Applecoin","statuses":["primary"]},{"code":"APT","name":"APT","statuses":["primary"]},{"code":"AR2","name":"AR2","statuses":["primary"]},{"code":"ARB","name":"ARB","statuses":["primary"]},{"code":"ARC","name":"ARC","statuses":["primary"]},{"code":"ARCH","name":"ARCH","statuses":["primary"]},{"code":"ABY","name":"ArtByte","statuses":["primary"]},{"code":"ARTC","name":"ARTC","statuses":["primary"]},{"code":"ADCN","name":"Asiadigicoin","statuses":["primary"]},{"code":"ATEN","name":"ATEN","statuses":["primary"]},{"code":"REP","name":"Augur","statuses":["primary"]},{"code":"AUR","name":"Auroracoin","statuses":["primary"]},{"code":"AUD","name":"Australian Dollar","statuses":["secondary"]},{"code":"AV","name":"AV","statuses":["primary"]},{"code":"BA","name":"BA","statuses":["primary"]},{"code":"BAC","name":"BAC","statuses":["primary"]},{"code":"BTA","name":"Bata","statuses":["primary"]},{"code":"BAY","name":"BAY","statuses":["primary"]},{"code":"BBCC","name":"BBCC","statuses":["primary"]},{"code":"BQC","name":"BBQCoin","statuses":["primary"]},{"code":"BDC","name":"BDC","statuses":["primary"]},{"code":"BEC","name":"BEC","statuses":["primary"]},{"code":"BEEZ","name":"BEEZ","statuses":["primary"]},{"code":"BELA","name":"BellaCoin","statuses":["primary"]},{"code":"BERN","name":"BERNcash","statuses":["primary"]},{"code":"BILL","name":"BILL","statuses":["primary"]},{"code":"BILS","name":"BILS","statuses":["primary"]},{"code":"BIOS","name":"BiosCrypto","statuses":["primary"]},{"code":"BIT","name":"BIT","statuses":["primary"]},{"code":"BIT16","name":"BIT16","statuses":["primary"]},{"code":"BITB","name":"BitBean","statuses":["primary"]},{"code":"BTC","name":"Bitcoin","statuses":["primary","secondary"]},{"code":"XBC","name":"Bitcoin Plus","statuses":["primary"]},{"code":"BTCD","name":"BitcoinDark","statuses":["primary"]},{"code":"BCY","name":"Bitcrystals","statuses":["primary"]},{"code":"BTM","name":"Bitmark","statuses":["primary"]},{"code":"BTQ","name":"BitQuark","statuses":["primary"]},{"code":"BITS","name":"BITS","statuses":["primary"]},{"code":"BSD","name":"BitSend","statuses":["primary"]},{"code":"BTS","name":"BitShares","statuses":["primary"]},{"code":"PTS","name":"BitShares PTS","statuses":["primary"]},{"code":"SWIFT","name":"BitSwift","statuses":["primary"]},{"code":"BITZ","name":"Bitz","statuses":["primary"]},{"code":"BLK","name":"Blackcoin","statuses":["primary"]},{"code":"JACK","name":"BlackJack","statuses":["primary"]},{"code":"BLC","name":"Blakecoin","statuses":["primary"]},{"code":"BLEU","name":"BLEU","statuses":["primary"]},{"code":"BLITZ","name":"Blitzcoin","statuses":["primary"]},{"code":"BLOCK","name":"Blocknet","statuses":["primary"]},{"code":"BLRY","name":"BLRY","statuses":["primary"]},{"code":"BLU","name":"BLU","statuses":["primary"]},{"code":"BM","name":"BM","statuses":["primary"]},{"code":"BNT","name":"BNT","statuses":["primary"]},{"code":"BOB","name":"BOB","statuses":["primary"]},{"code":"BON","name":"BON","statuses":["primary"]},{"code":"BBR","name":"Boolberry","statuses":["primary"]},{"code":"BOST","name":"BoostCoin","statuses":["primary"]},{"code":"BOSS","name":"BOSS","statuses":["primary"]},{"code":"BPOK","name":"BPOK","statuses":["primary"]},{"code":"BRAIN","name":"BRAIN","statuses":["primary"]},{"code":"BRC","name":"BRC","statuses":["primary"]},{"code":"BRDD","name":"BRDD","statuses":["primary"]},{"code":"BRIT","name":"BRIT","statuses":["primary"]},{"code":"GBP","name":"British Pound Sterling","statuses":["secondary"]},{"code":"BRK","name":"BRK","statuses":["primary"]},{"code":"BRX","name":"BRX","statuses":["primary"]},{"code":"BSC","name":"BSC","statuses":["primary"]},{"code":"BST","name":"BST","statuses":["primary"]},{"code":"BTCHC","name":"BTCHC","statuses":["primary"]},{"code":"BTCR","name":"BTCR","statuses":["primary"]},{"code":"BTCS","name":"BTCS","statuses":["primary"]},{"code":"BTCU","name":"BTCU","statuses":["primary"]},{"code":"BTTF","name":"BTTF","statuses":["primary"]},{"code":"BTX","name":"BTX","statuses":["primary"]},{"code":"BUCKS","name":"BUCKS","statuses":["primary"]},{"code":"BUN","name":"BUN","statuses":["primary"]},{"code":"BURST","name":"Burst","statuses":["primary"]},{"code":"BUZZ","name":"BUZZ","statuses":["primary"]},{"code":"BVC","name":"BVC","statuses":["primary"]},{"code":"BYC","name":"Bytecent","statuses":["primary"]},{"code":"BCN","name":"Bytecoin","statuses":["primary"]},{"code":"XCT","name":"C-Bit","statuses":["primary"]},{"code":"C0C0","name":"C0C0","statuses":["primary"]},{"code":"CAB","name":"Cabbage Unit","statuses":["primary"]},{"code":"CAD","name":"CAD","statuses":["primary","secondary"]},{"code":"CAGE","name":"CAGE","statuses":["primary"]},{"code":"CANN","name":"CannabisCoin","statuses":["primary"]},{"code":"CCN","name":"Cannacoin","statuses":["primary"]},{"code":"CPC","name":"Capricoin","statuses":["primary"]},{"code":"DIEM","name":"CarpeDiemCoin","statuses":["primary"]},{"code":"CASH","name":"CASH","statuses":["primary"]},{"code":"CBIT","name":"CBIT","statuses":["primary"]},{"code":"CC","name":"CC","statuses":["primary"]},{"code":"CCB","name":"CCB","statuses":["primary"]},{"code":"CD","name":"CD","statuses":["primary"]},{"code":"CDN","name":"CDN","statuses":["primary"]},{"code":"CF","name":"CF","statuses":["primary"]},{"code":"CFC","name":"CFC","statuses":["primary"]},{"code":"CGA","name":"CGA","statuses":["primary"]},{"code":"CHC","name":"CHC","statuses":["primary"]},{"code":"CKC","name":"Checkcoin","statuses":["primary"]},{"code":"CHEMX","name":"CHEMX","statuses":["primary"]},{"code":"CHESS","name":"CHESS","statuses":["primary"]},{"code":"CHF","name":"CHF","statuses":["primary","secondary"]},{"code":"CNY","name":"Chinese Yuan","statuses":["secondary"]},{"code":"CHRG","name":"CHRG","statuses":["primary"]},{"code":"CJ","name":"CJ","statuses":["primary"]},{"code":"CLAM","name":"Clams","statuses":["primary"]},{"code":"CLICK","name":"CLICK","statuses":["primary"]},{"code":"CLINT","name":"CLINT","statuses":["primary"]},{"code":"CLOAK","name":"Cloakcoin","statuses":["primary"]},{"code":"CLR","name":"CLR","statuses":["primary"]},{"code":"CLUB","name":"CLUB","statuses":["primary"]},{"code":"CLUD","name":"CLUD","statuses":["primary"]},{"code":"CMT","name":"CMT","statuses":["primary"]},{"code":"CNC","name":"CNC","statuses":["primary"]},{"code":"COXST","name":"CoExistCoin","statuses":["primary"]},{"code":"COIN","name":"COIN","statuses":["primary"]},{"code":"C2","name":"Coin2.1","statuses":["primary"]},{"code":"CNMT","name":"Coinomat","statuses":["primary"]},{"code":"CV2","name":"Colossuscoin2.0","statuses":["primary"]},{"code":"CON","name":"CON","statuses":["primary"]},{"code":"XCP","name":"Counterparty","statuses":["primary"]},{"code":"COV","name":"COV","statuses":["primary"]},{"code":"CRAFT","name":"CRAFT","statuses":["primary"]},{"code":"CRAVE","name":"CRAVE","statuses":["primary"]},{"code":"CRC","name":"CRC","statuses":["primary"]},{"code":"CRE","name":"CRE","statuses":["primary"]},{"code":"CRBIT","name":"Creditbit","statuses":["primary"]},{"code":"CREVA","name":"CrevaCoin","statuses":["primary"]},{"code":"CRIME","name":"CRIME","statuses":["primary"]},{"code":"CRT","name":"CRT","statuses":["primary"]},{"code":"CRW","name":"CRW","statuses":["primary"]},{"code":"CRY","name":"CRY","statuses":["primary"]},{"code":"XCR","name":"Crypti","statuses":["primary"]},{"code":"CBX","name":"Crypto Bullion","statuses":["primary"]},{"code":"CESC","name":"CryptoEscudo","statuses":["primary"]},{"code":"XCN","name":"Cryptonite","statuses":["primary"]},{"code":"CSMIC","name":"CSMIC","statuses":["primary"]},{"code":"CST","name":"CST","statuses":["primary"]},{"code":"CTC","name":"CTC","statuses":["primary"]},{"code":"CTO","name":"CTO","statuses":["primary"]},{"code":"CURE","name":"Curecoin","statuses":["primary"]},{"code":"CYP","name":"Cypher","statuses":["primary"]},{"code":"CZC","name":"CZC","statuses":["primary"]},{"code":"CZECO","name":"CZECO","statuses":["primary"]},{"code":"CZR","name":"CZR","statuses":["primary"]},{"code":"DAO","name":"DAO","statuses":["primary"]},{"code":"DGD","name":"DarkGoldCoin","statuses":["primary"]},{"code":"DNET","name":"Darknet","statuses":["primary"]},{"code":"DASH","name":"Dash","statuses":["primary"]},{"code":"DTC","name":"Datacoin","statuses":["primary"]},{"code":"DBG","name":"DBG","statuses":["primary"]},{"code":"DBLK","name":"DBLK","statuses":["primary"]},{"code":"DBTC","name":"DBTC","statuses":["primary"]},{"code":"DCK","name":"DCK","statuses":["primary"]},{"code":"DCR","name":"Decred","statuses":["primary"]},{"code":"DES","name":"Destiny","statuses":["primary"]},{"code":"DETH","name":"DETH","statuses":["primary"]},{"code":"DEUR","name":"DEUR","statuses":["primary"]},{"code":"DEM","name":"Deutsche eMark","statuses":["primary"]},{"code":"DVC","name":"Devcoin","statuses":["primary"]},{"code":"DGCS","name":"DGCS","statuses":["primary"]},{"code":"DGMS","name":"DGMS","statuses":["primary"]},{"code":"DGORE","name":"DGORE","statuses":["primary"]},{"code":"DMD","name":"Diamond","statuses":["primary"]},{"code":"DGB","name":"Digibyte","statuses":["primary"]},{"code":"CUBE","name":"DigiCube","statuses":["primary"]},{"code":"DGC","name":"Digitalcoin","statuses":["primary"]},{"code":"XDN","name":"DigitalNote","statuses":["primary"]},{"code":"DP","name":"DigitalPrice","statuses":["primary"]},{"code":"DIGS","name":"DIGS","statuses":["primary"]},{"code":"DIME","name":"Dimecoin","statuses":["primary"]},{"code":"DISK","name":"DISK","statuses":["primary"]},{"code":"DLISK","name":"DLISK","statuses":["primary"]},{"code":"NOTE","name":"DNotes","statuses":["primary"]},{"code":"DOGE","name":"DOGE","statuses":["primary","secondary"]},{"code":"DOGE","name":"Dogecoin","statuses":["primary","secondary"]},{"code":"DON","name":"DON","statuses":["primary"]},{"code":"DOPE","name":"DopeCoin","statuses":["primary"]},{"code":"DOX","name":"DOX","statuses":["primary"]},{"code":"DRACO","name":"DRACO","statuses":["primary"]},{"code":"DRM","name":"DRM","statuses":["primary"]},{"code":"DROP","name":"DROP","statuses":["primary"]},{"code":"DRZ","name":"DRZ","statuses":["primary"]},{"code":"DSH","name":"DSH","statuses":["primary"]},{"code":"DBIC","name":"DubaiCoin","statuses":["primary"]},{"code":"DUO","name":"DUO","statuses":["primary"]},{"code":"DUST","name":"DUST","statuses":["primary"]},{"code":"EAC","name":"Earthcoin","statuses":["primary"]},{"code":"ECCHI","name":"ECCHI","statuses":["primary"]},{"code":"ECC","name":"ECCoin","statuses":["primary"]},{"code":"ECOS","name":"ECOS","statuses":["primary"]},{"code":"EDC","name":"EDC","statuses":["primary"]},{"code":"EDRC","name":"EDRC","statuses":["primary"]},{"code":"EGG","name":"EGG","statuses":["primary"]},{"code":"EMC2","name":"Einsteinium","statuses":["primary"]},{"code":"EKO","name":"EKO","statuses":["primary"]},{"code":"EL","name":"EL","statuses":["primary"]},{"code":"ELCO","name":"ELcoin","statuses":["primary"]},{"code":"ELE","name":"ELE","statuses":["primary"]},{"code":"EFL","name":"Electronic Gulden","statuses":["primary"]},{"code":"EMC","name":"Emercoin","statuses":["primary"]},{"code":"EMIRG","name":"EMIRG","statuses":["primary"]},{"code":"ENE","name":"ENE","statuses":["primary"]},{"code":"ENRG","name":"Energycoin","statuses":["primary"]},{"code":"EPC","name":"EPC","statuses":["primary"]},{"code":"EPY","name":"EPY","statuses":["primary"]},{"code":"ERC","name":"ERC","statuses":["primary"]},{"code":"ERC3","name":"ERC3","statuses":["primary"]},{"code":"ESC","name":"ESC","statuses":["primary"]},{"code":"ETH","name":"Ethereum","statuses":["primary","secondary"]},{"code":"ETC","name":"Ethereum Classic","statuses":["primary"]},{"code":"ETHS","name":"ETHS","statuses":["primary"]},{"code":"EURC","name":"EURC","statuses":["primary"]},{"code":"EUR","name":"Euro","statuses":["primary","secondary"]},{"code":"EGC","name":"EvergreenCoin","statuses":["primary"]},{"code":"EVIL","name":"EVIL","statuses":["primary"]},{"code":"EVO","name":"EVO","statuses":["primary"]},{"code":"EXCL","name":"EXCL","statuses":["primary"]},{"code":"EXIT","name":"EXIT","statuses":["primary"]},{"code":"EXP","name":"Expanse","statuses":["primary"]},{"code":"FCT","name":"Factom","statuses":["primary"]},{"code":"FAIR","name":"Faircoin","statuses":["primary"]},{"code":"FC2","name":"FC2","statuses":["primary"]},{"code":"FCN","name":"FCN","statuses":["primary"]},{"code":"FTC","name":"Feathercoin","statuses":["primary"]},{"code":"TIPS","name":"Fedoracoin","statuses":["primary"]},{"code":"FFC","name":"FFC","statuses":["primary"]},{"code":"FIBRE","name":"Fibre","statuses":["primary"]},{"code":"FIT","name":"FIT","statuses":["primary"]},{"code":"FJC","name":"FJC","statuses":["primary"]},{"code":"FLO","name":"Florincoin","statuses":["primary"]},{"code":"FLOZ","name":"FLOZ","statuses":["primary"]},{"code":"FLT","name":"FlutterCoin","statuses":["primary"]},{"code":"FLX","name":"FLX","statuses":["primary"]},{"code":"FLY","name":"Flycoin","statuses":["primary"]},{"code":"FLDC","name":"FoldingCoin","statuses":["primary"]},{"code":"FONZ","name":"FONZ","statuses":["primary"]},{"code":"FRK","name":"Franko","statuses":["primary"]},{"code":"FRC","name":"Freicoin","statuses":["primary"]},{"code":"FRN","name":"FRN","statuses":["primary"]},{"code":"FRWC","name":"FRWC","statuses":["primary"]},{"code":"FSC2","name":"FSC2","statuses":["primary"]},{"code":"FST","name":"FST","statuses":["primary"]},{"code":"FTP","name":"FTP","statuses":["primary"]},{"code":"FUN","name":"FUN","statuses":["primary"]},{"code":"FUTC","name":"FUTC","statuses":["primary"]},{"code":"FUZZ","name":"FUZZ","statuses":["primary"]},{"code":"GAIA","name":"GAIA","statuses":["primary"]},{"code":"GAIN","name":"GAIN","statuses":["primary"]},{"code":"GAKH","name":"GAKH","statuses":["primary"]},{"code":"GAM","name":"GAM","statuses":["primary"]},{"code":"GBT","name":"GameBet Coin","statuses":["primary"]},{"code":"GAME","name":"GameCredits","statuses":["primary"]},{"code":"GAP","name":"Gapcoin","statuses":["primary"]},{"code":"GARY","name":"GARY","statuses":["primary"]},{"code":"GB","name":"GB","statuses":["primary"]},{"code":"GBC","name":"GBC","statuses":["primary"]},{"code":"GBIT","name":"GBIT","statuses":["primary"]},{"code":"GCC","name":"GCC","statuses":["primary"]},{"code":"GCN","name":"GCN","statuses":["primary"]},{"code":"GEO","name":"GeoCoin","statuses":["primary"]},{"code":"GEMZ","name":"GetGems","statuses":["primary"]},{"code":"GHOST","name":"GHOST","statuses":["primary"]},{"code":"GHS","name":"GHS","statuses":["primary"]},{"code":"GIFT","name":"GIFT","statuses":["primary"]},{"code":"GIG","name":"GIG","statuses":["primary"]},{"code":"GLC","name":"GLC","statuses":["primary"]},{"code":"BSTY","name":"GlobalBoost-Y","statuses":["primary"]},{"code":"GML","name":"GML","statuses":["primary"]},{"code":"GMX","name":"GMX","statuses":["primary"]},{"code":"GCR","name":"GoCoineR","statuses":["primary"]},{"code":"GLD","name":"GoldCoin","statuses":["primary"]},{"code":"GOON","name":"GOON","statuses":["primary"]},{"code":"GP","name":"GP","statuses":["primary"]},{"code":"GPU","name":"GPU","statuses":["primary"]},{"code":"GRAM","name":"GRAM","statuses":["primary"]},{"code":"GRT","name":"Grantcoin","statuses":["primary"]},{"code":"GRE","name":"GRE","statuses":["primary"]},{"code":"GRC","name":"Gridcoin","statuses":["primary"]},{"code":"GRN","name":"GRN","statuses":["primary"]},{"code":"GRS","name":"Groestlcoin","statuses":["primary"]},{"code":"GRW","name":"GRW","statuses":["primary"]},{"code":"GSM","name":"GSM","statuses":["primary"]},{"code":"GSX","name":"GSX","statuses":["primary"]},{"code":"GUA","name":"GUA","statuses":["primary"]},{"code":"NLG","name":"Gulden","statuses":["primary"]},{"code":"GUN","name":"GUN","statuses":["primary"]},{"code":"HAM","name":"HAM","statuses":["primary"]},{"code":"HAWK","name":"HAWK","statuses":["primary"]},{"code":"HCC","name":"HCC","statuses":["primary"]},{"code":"HEAT","name":"HEAT","statuses":["primary"]},{"code":"HMP","name":"HempCoin","statuses":["primary"]},{"code":"XHI","name":"HiCoin","statuses":["primary"]},{"code":"HIFUN","name":"HIFUN","statuses":["primary"]},{"code":"HILL","name":"HILL","statuses":["primary"]},{"code":"HIRE","name":"HIRE","statuses":["primary"]},{"code":"HNC","name":"HNC","statuses":["primary"]},{"code":"HODL","name":"HOdlcoin","statuses":["primary"]},{"code":"HKD","name":"Hong Kong Dollar","statuses":["secondary"]},{"code":"HZ","name":"Horizon","statuses":["primary"]},{"code":"HTC","name":"HTC","statuses":["primary"]},{"code":"HTML5","name":"HTMLCOIN","statuses":["primary"]},{"code":"HUC","name":"HUC","statuses":["primary"]},{"code":"HVCO","name":"HVCO","statuses":["primary"]},{"code":"HYPER","name":"Hyper","statuses":["primary"]},{"code":"HYP","name":"HyperStake","statuses":["primary"]},{"code":"I0C","name":"I0C","statuses":["primary"]},{"code":"IBANK","name":"IBANK","statuses":["primary"]},{"code":"ICASH","name":"iCash","statuses":["primary"]},{"code":"ICN","name":"ICN","statuses":["primary"]},{"code":"IEC","name":"IEC","statuses":["primary"]},{"code":"IFC","name":"Infinitecoin","statuses":["primary"]},{"code":"INFX","name":"Influxcoin","statuses":["primary"]},{"code":"INV","name":"INV","statuses":["primary"]},{"code":"IOC","name":"IO Coin","statuses":["primary"]},{"code":"ION","name":"ION","statuses":["primary"]},{"code":"IRL","name":"IRL","statuses":["primary"]},{"code":"ISL","name":"IslaCoin","statuses":["primary"]},{"code":"IVZ","name":"IVZ","statuses":["primary"]},{"code":"IXC","name":"IXC","statuses":["primary"]},{"code":"JIF","name":"JIF","statuses":["primary"]},{"code":"JPC","name":"JPC","statuses":["primary"]},{"code":"JPY","name":"JPY","statuses":["primary","secondary"]},{"code":"JBS","name":"Jumbucks","statuses":["primary"]},{"code":"KAT","name":"KAT","statuses":["primary"]},{"code":"KGC","name":"KGC","statuses":["primary"]},{"code":"KNC","name":"KhanCoin","statuses":["primary"]},{"code":"KLC","name":"KLC","statuses":["primary"]},{"code":"KOBO","name":"KOBO","statuses":["primary"]},{"code":"KORE","name":"KoreCoin","statuses":["primary"]},{"code":"KRAK","name":"KRAK","statuses":["primary"]},{"code":"KRYP","name":"KRYP","statuses":["primary"]},{"code":"KR","name":"Krypton","statuses":["primary"]},{"code":"KTK","name":"KTK","statuses":["primary"]},{"code":"KUBO","name":"KUBO","statuses":["primary"]},{"code":"LANA","name":"LANA","statuses":["primary"]},{"code":"LBC","name":"LBC","statuses":["primary"]},{"code":"LC","name":"LC","statuses":["primary"]},{"code":"LEA","name":"LeaCoin","statuses":["primary"]},{"code":"LEMON","name":"LEMON","statuses":["primary"]},{"code":"LEO","name":"LEO","statuses":["primary"]},{"code":"LFC","name":"LFC","statuses":["primary"]},{"code":"LFO","name":"LFO","statuses":["primary"]},{"code":"LFTC","name":"LFTC","statuses":["primary"]},{"code":"LQD","name":"LIQUID","statuses":["primary"]},{"code":"LIR","name":"LIR","statuses":["primary"]},{"code":"LSK","name":"Lisk","statuses":["primary"]},{"code":"LTC","name":"Litecoin","statuses":["primary","secondary"]},{"code":"LTCR","name":"Litecred","statuses":["primary"]},{"code":"LDOGE","name":"LiteDoge","statuses":["primary"]},{"code":"LKC","name":"LKC","statuses":["primary"]},{"code":"LOC","name":"LOC","statuses":["primary"]},{"code":"LOOT","name":"LOOT","statuses":["primary"]},{"code":"LTBC","name":"LTBcoin","statuses":["primary"]},{"code":"LTC","name":"LTC","statuses":["primary","secondary"]},{"code":"LTH","name":"LTH","statuses":["primary"]},{"code":"LTS","name":"LTS","statuses":["primary"]},{"code":"LUN","name":"LUN","statuses":["primary"]},{"code":"LXC","name":"LXC","statuses":["primary"]},{"code":"LYB","name":"LYB","statuses":["primary"]},{"code":"M1","name":"M1","statuses":["primary"]},{"code":"MAD","name":"MAD","statuses":["primary"]},{"code":"XMG","name":"Magi","statuses":["primary"]},{"code":"MAID","name":"MaidSafeCoin","statuses":["primary"]},{"code":"MXT","name":"MarteXcoin","statuses":["primary"]},{"code":"MARV","name":"MARV","statuses":["primary"]},{"code":"MARYJ","name":"MARYJ","statuses":["primary"]},{"code":"OMNI","name":"Mastercoin (Omni)","statuses":["primary"]},{"code":"MTR","name":"MasterTraderCoin","statuses":["primary"]},{"code":"MAX","name":"Maxcoin","statuses":["primary"]},{"code":"MZC","name":"Mazacoin","statuses":["primary"]},{"code":"MBL","name":"MBL","statuses":["primary"]},{"code":"MCAR","name":"MCAR","statuses":["primary"]},{"code":"MCN","name":"MCN","statuses":["primary"]},{"code":"MCZ","name":"MCZ","statuses":["primary"]},{"code":"MED","name":"MediterraneanCoin","statuses":["primary"]},{"code":"MEC","name":"Megacoin","statuses":["primary"]},{"code":"MEME","name":"Memetic","statuses":["primary"]},{"code":"METAL","name":"METAL","statuses":["primary"]},{"code":"MND","name":"MindCoin","statuses":["primary"]},{"code":"MINT","name":"Mintcoin","statuses":["primary"]},{"code":"MIS","name":"MIS","statuses":["primary"]},{"code":"MM","name":"MM","statuses":["primary"]},{"code":"MMC","name":"MMC","statuses":["primary"]},{"code":"MMNXT","name":"MMNXT","statuses":["primary"]},{"code":"MMXVI","name":"MMXVI","statuses":["primary"]},{"code":"MNM","name":"MNM","statuses":["primary"]},{"code":"MOIN","name":"MOIN","statuses":["primary"]},{"code":"MOJO","name":"MojoCoin","statuses":["primary"]},{"code":"MONA","name":"MonaCoin","statuses":["primary"]},{"code":"XMR","name":"Monero","statuses":["primary","secondary"]},{"code":"MNTA","name":"Moneta","statuses":["primary"]},{"code":"MUE","name":"MonetaryUnit","statuses":["primary"]},{"code":"MOON","name":"Mooncoin","statuses":["primary"]},{"code":"MOOND","name":"MOOND","statuses":["primary"]},{"code":"MOTO","name":"MOTO","statuses":["primary"]},{"code":"MPRO","name":"MPRO","statuses":["primary"]},{"code":"MRB","name":"MRB","statuses":["primary"]},{"code":"MRP","name":"MRP","statuses":["primary"]},{"code":"MSC","name":"MSC","statuses":["primary"]},{"code":"MYR","name":"Myriadcoin","statuses":["primary"]},{"code":"NMC","name":"Namecoin","statuses":["primary"]},{"code":"NAUT","name":"Nautiluscoin","statuses":["primary"]},{"code":"NAV","name":"NAV Coin","statuses":["primary"]},{"code":"NCS","name":"NCS","statuses":["primary"]},{"code":"XEM","name":"NEM","statuses":["primary"]},{"code":"NEOS","name":"NeosCoin","statuses":["primary"]},{"code":"NETC","name":"NETC","statuses":["primary"]},{"code":"NET","name":"NetCoin","statuses":["primary"]},{"code":"NEU","name":"NeuCoin","statuses":["primary"]},{"code":"NTRN","name":"Neutron","statuses":["primary"]},{"code":"NEVA","name":"NevaCoin","statuses":["primary"]},{"code":"NEWB","name":"NEWB","statuses":["primary"]},{"code":"NIRO","name":"Nexus","statuses":["primary"]},{"code":"NIC","name":"NIC","statuses":["primary"]},{"code":"NKA","name":"NKA","statuses":["primary"]},{"code":"NKC","name":"NKC","statuses":["primary"]},{"code":"NOBL","name":"NobleCoin","statuses":["primary"]},{"code":"NODE","name":"NODE","statuses":["primary"]},{"code":"NODES","name":"NODES","statuses":["primary"]},{"code":"NOO","name":"NOO","statuses":["primary"]},{"code":"NVC","name":"Novacoin","statuses":["primary"]},{"code":"NRC","name":"NRC","statuses":["primary"]},{"code":"NRS","name":"NRS","statuses":["primary"]},{"code":"NUBIS","name":"NUBIS","statuses":["primary"]},{"code":"NBT","name":"NuBits","statuses":["primary"]},{"code":"NUM","name":"NUM","statuses":["primary"]},{"code":"NSR","name":"NuShares","statuses":["primary"]},{"code":"NXE","name":"NXE","statuses":["primary"]},{"code":"NXT","name":"NXT","statuses":["primary"]},{"code":"NXTTY","name":"Nxttycoin","statuses":["primary"]},{"code":"NYC","name":"NYC","statuses":["primary"]},{"code":"NZC","name":"NZC","statuses":["primary"]},{"code":"NZD","name":"NZD","statuses":["primary","secondary"]},{"code":"OC","name":"OC","statuses":["primary"]},{"code":"OCOW","name":"OCOW","statuses":["primary"]},{"code":"OK","name":"OKCash","statuses":["primary"]},{"code":"OMA","name":"OMA","statuses":["primary"]},{"code":"ONE","name":"ONE","statuses":["primary"]},{"code":"ONEC","name":"ONEC","statuses":["primary"]},{"code":"OP","name":"OP","statuses":["primary"]},{"code":"OPAL","name":"OPAL","statuses":["primary"]},{"code":"OPES","name":"OPES","statuses":["primary"]},{"code":"ORB","name":"Orbitcoin","statuses":["primary"]},{"code":"ORLY","name":"Orlycoin","statuses":["primary"]},{"code":"OS76","name":"OS76","statuses":["primary"]},{"code":"OZC","name":"OZC","statuses":["primary"]},{"code":"PAC","name":"PAC","statuses":["primary"]},{"code":"PAK","name":"PAK","statuses":["primary"]},{"code":"PND","name":"Pandacoin","statuses":["primary"]},{"code":"PAPAF","name":"PAPAF","statuses":["primary"]},{"code":"XPY","name":"Paycoin","statuses":["primary"]},{"code":"PBC","name":"PBC","statuses":["primary"]},{"code":"PDC","name":"PDC","statuses":["primary"]},{"code":"XPB","name":"Pebblecoin","statuses":["primary"]},{"code":"PPC","name":"Peercoin","statuses":["primary"]},{"code":"PEN","name":"PEN","statuses":["primary"]},{"code":"PHR","name":"PHR","statuses":["primary"]},{"code":"PIGGY","name":"Piggycoin","statuses":["primary"]},{"code":"PC","name":"Pinkcoin","statuses":["primary"]},{"code":"PKB","name":"PKB","statuses":["primary"]},{"code":"PLN","name":"PLN","statuses":["primary","secondary"]},{"code":"PLNC","name":"PLNC","statuses":["primary"]},{"code":"PNC","name":"PNC","statuses":["primary"]},{"code":"PNK","name":"PNK","statuses":["primary"]},{"code":"POKE","name":"POKE","statuses":["primary"]},{"code":"PONZ2","name":"PONZ2","statuses":["primary"]},{"code":"PONZI","name":"PONZI","statuses":["primary"]},{"code":"PEX","name":"PosEx","statuses":["primary"]},{"code":"POST","name":"POST","statuses":["primary"]},{"code":"POT","name":"Potcoin","statuses":["primary"]},{"code":"PRES","name":"PRES","statuses":["primary"]},{"code":"PXI","name":"Prime-XI","statuses":["primary"]},{"code":"PRIME","name":"PrimeChain","statuses":["primary"]},{"code":"XPM","name":"Primecoin","statuses":["primary"]},{"code":"PRM","name":"PRM","statuses":["primary"]},{"code":"PRT","name":"PRT","statuses":["primary"]},{"code":"PSP","name":"PSP","statuses":["primary"]},{"code":"PTC","name":"PTC","statuses":["primary"]},{"code":"PULSE","name":"PULSE","statuses":["primary"]},{"code":"PURE","name":"PURE","statuses":["primary"]},{"code":"PUTIN","name":"PUTIN","statuses":["primary"]},{"code":"PWR","name":"PWR","statuses":["primary"]},{"code":"PXL","name":"PXL","statuses":["primary"]},{"code":"QBC","name":"QBC","statuses":["primary"]},{"code":"QBK","name":"QBK","statuses":["primary"]},{"code":"QCN","name":"QCN","statuses":["primary"]},{"code":"QORA","name":"Qora","statuses":["primary"]},{"code":"QTZ","name":"QTZ","statuses":["primary"]},{"code":"QRK","name":"Quark","statuses":["primary"]},{"code":"QTL","name":"Quatloo","statuses":["primary"]},{"code":"RADI","name":"RADI","statuses":["primary"]},{"code":"RADS","name":"Radium","statuses":["primary"]},{"code":"RED","name":"RED","statuses":["primary"]},{"code":"RDD","name":"Reddcoin","statuses":["primary"]},{"code":"REE","name":"REE","statuses":["primary"]},{"code":"REV","name":"Revenu","statuses":["primary"]},{"code":"RBR","name":"RibbitRewards","statuses":["primary"]},{"code":"RICHX","name":"RICHX","statuses":["primary"]},{"code":"RIC","name":"Riecoin","statuses":["primary"]},{"code":"RBT","name":"Rimbit","statuses":["primary"]},{"code":"RIO","name":"RIO","statuses":["primary"]},{"code":"XRP","name":"Ripple","statuses":["primary"]},{"code":"RISE","name":"RISE","statuses":["primary"]},{"code":"RMS","name":"RMS","statuses":["primary"]},{"code":"RONIN","name":"RONIN","statuses":["primary"]},{"code":"ROOT","name":"ROOT","statuses":["primary"]},{"code":"ROS","name":"RosCoin","statuses":["primary"]},{"code":"RPC","name":"RPC","statuses":["primary"]},{"code":"RBIES","name":"Rubies","statuses":["primary"]},{"code":"RUBIT","name":"RUBIT","statuses":["primary"]},{"code":"RUR","name":"Ruble","statuses":["secondary"]},{"code":"RBY","name":"Rubycoin","statuses":["primary"]},{"code":"RUST","name":"RUST","statuses":["primary"]},{"code":"SEC","name":"Safe Exchange Coin","statuses":["primary"]},{"code":"SAK","name":"SAK","statuses":["primary"]},{"code":"SAR","name":"SAR","statuses":["primary"]},{"code":"SBD","name":"SBD","statuses":["primary"]},{"code":"SBIT","name":"SBIT","statuses":["primary"]},{"code":"SCAN","name":"SCAN","statuses":["primary"]},{"code":"SCOT","name":"Scotcoin","statuses":["primary"]},{"code":"SCRPT","name":"SCRPT","statuses":["primary"]},{"code":"SCRT","name":"SCRT","statuses":["primary"]},{"code":"SRC","name":"SecureCoin","statuses":["primary"]},{"code":"SXC","name":"Sexcoin","statuses":["primary"]},{"code":"SFE","name":"SFE","statuses":["primary"]},{"code":"SFR","name":"SFR","statuses":["primary"]},{"code":"SGD","name":"SGD","statuses":["primary","secondary"]},{"code":"SDC","name":"ShadowCash","statuses":["primary"]},{"code":"SHELL","name":"SHELL","statuses":["primary"]},{"code":"SHF","name":"SHF","statuses":["primary"]},{"code":"SHI","name":"SHI","statuses":["primary"]},{"code":"SHIFT","name":"Shift","statuses":["primary"]},{"code":"SHREK","name":"SHREK","statuses":["primary"]},{"code":"SC","name":"Siacoin","statuses":["primary"]},{"code":"SIB","name":"Siberian chervonets","statuses":["primary"]},{"code":"SIC","name":"SIC","statuses":["primary"]},{"code":"SIGU","name":"SIGU","statuses":["primary"]},{"code":"SILK","name":"Silkcoin","statuses":["primary"]},{"code":"SIX","name":"SIX","statuses":["primary"]},{"code":"SLING","name":"Sling","statuses":["primary"]},{"code":"SLS","name":"SLS","statuses":["primary"]},{"code":"SMBR","name":"SMBR","statuses":["primary"]},{"code":"SMC","name":"SMC","statuses":["primary"]},{"code":"SMLY","name":"SmileyCoin","statuses":["primary"]},{"code":"SNRG","name":"SNRG","statuses":["primary"]},{"code":"SOIL","name":"SOILcoin","statuses":["primary"]},{"code":"SLR","name":"Solarcoin","statuses":["primary"]},{"code":"SOLO","name":"SOLO","statuses":["primary"]},{"code":"SONG","name":"SongCoin","statuses":["primary"]},{"code":"SOON","name":"SOON","statuses":["primary"]},{"code":"SPC","name":"SPC","statuses":["primary"]},{"code":"SPEX","name":"SPEX","statuses":["primary"]},{"code":"SPHR","name":"Sphere","statuses":["primary"]},{"code":"SPM","name":"SPM","statuses":["primary"]},{"code":"SPN","name":"SPN","statuses":["primary"]},{"code":"SPOTS","name":"SPOTS","statuses":["primary"]},{"code":"SPR","name":"SpreadCoin","statuses":["primary"]},{"code":"SPRTS","name":"Sprouts","statuses":["primary"]},{"code":"SQC","name":"SQC","statuses":["primary"]},{"code":"SSC","name":"SSC","statuses":["primary"]},{"code":"SSTC","name":"SSTC","statuses":["primary"]},{"code":"STA","name":"STA","statuses":["primary"]},{"code":"START","name":"Startcoin","statuses":["primary"]},{"code":"XST","name":"Stealthcoin","statuses":["primary"]},{"code":"STEEM","name":"Steem","statuses":["primary"]},{"code":"XLM","name":"Stellar","statuses":["primary"]},{"code":"STR","name":"Stellar","statuses":["primary"]},{"code":"STEPS","name":"Steps","statuses":["primary"]},{"code":"SLG","name":"Sterlingcoin","statuses":["primary"]},{"code":"STL","name":"STL","statuses":["primary"]},{"code":"SJCX","name":"Storjcoin X","statuses":["primary"]},{"code":"STP","name":"STP","statuses":["primary"]},{"code":"STRB","name":"STRB","statuses":["primary"]},{"code":"STS","name":"Stress","statuses":["primary"]},{"code":"STRP","name":"STRP","statuses":["primary"]},{"code":"STV","name":"STV","statuses":["primary"]},{"code":"SUB","name":"Subcriptio","statuses":["primary"]},{"code":"SUPER","name":"SUPER","statuses":["primary"]},{"code":"UNITY","name":"SuperNET","statuses":["primary"]},{"code":"SWARM","name":"Swarm","statuses":["primary"]},{"code":"SWING","name":"SWING","statuses":["primary"]},{"code":"SDP","name":"SydPak Coin","statuses":["primary"]},{"code":"SYNC","name":"SYNC","statuses":["primary"]},{"code":"AMP","name":"Synereo","statuses":["primary"]},{"code":"SYS","name":"Syscoin","statuses":["primary"]},{"code":"TAG","name":"TagCoin","statuses":["primary"]},{"code":"TAJ","name":"TAJ","statuses":["primary"]},{"code":"TAK","name":"TAK","statuses":["primary"]},{"code":"TAM","name":"TAM","statuses":["primary"]},{"code":"TAO","name":"TAO","statuses":["primary"]},{"code":"TBC","name":"TBC","statuses":["primary"]},{"code":"TBCX","name":"TBCX","statuses":["primary"]},{"code":"TCR","name":"TCR","statuses":["primary"]},{"code":"TDFB","name":"TDFB","statuses":["primary"]},{"code":"TDY","name":"TDY","statuses":["primary"]},{"code":"TEK","name":"TEKcoin","statuses":["primary"]},{"code":"TRC","name":"Terracoin","statuses":["primary"]},{"code":"TESLA","name":"TESLA","statuses":["primary"]},{"code":"TES","name":"TeslaCoin","statuses":["primary"]},{"code":"TET","name":"TET","statuses":["primary"]},{"code":"USDT","name":"Tether","statuses":["primary","secondary"]},{"code":"THC","name":"THC","statuses":["primary"]},{"code":"THS","name":"THS","statuses":["primary"]},{"code":"TIX","name":"Tickets","statuses":["primary"]},{"code":"XTC","name":"TileCoin","statuses":["primary"]},{"code":"TIT","name":"Titcoin","statuses":["primary"]},{"code":"TTC","name":"TittieCoin","statuses":["primary"]},{"code":"TMC","name":"TMC","statuses":["primary"]},{"code":"TODAY","name":"TODAY","statuses":["primary"]},{"code":"TOKEN","name":"TOKEN","statuses":["primary"]},{"code":"TP1","name":"TP1","statuses":["primary"]},{"code":"TPC","name":"TPC","statuses":["primary"]},{"code":"TPG","name":"TPG","statuses":["primary"]},{"code":"TX","name":"Transfercoin","statuses":["primary"]},{"code":"TRAP","name":"TRAP","statuses":["primary"]},{"code":"TRICK","name":"TRICK","statuses":["primary"]},{"code":"TROLL","name":"TROLL","statuses":["primary"]},{"code":"TRK","name":"Truckcoin","statuses":["primary"]},{"code":"TRUMP","name":"TrumpCoin","statuses":["primary"]},{"code":"TRUST","name":"TRUST","statuses":["primary"]},{"code":"UAE","name":"UAE","statuses":["primary"]},{"code":"UFO","name":"UFO Coin","statuses":["primary"]},{"code":"UIS","name":"UIS","statuses":["primary"]},{"code":"UTC","name":"UltraCoin","statuses":["primary"]},{"code":"UNC","name":"UNC","statuses":["primary"]},{"code":"UNIQ","name":"UNIQ","statuses":["primary"]},{"code":"UNIT","name":"Universal Currency","statuses":["primary"]},{"code":"UNO","name":"Unobtanium","statuses":["primary"]},{"code":"URO","name":"Uro","statuses":["primary"]},{"code":"USD","name":"US Dollar","statuses":["primary","secondary"]},{"code":"USDE","name":"USDE","statuses":["primary"]},{"code":"UTH","name":"UTH","statuses":["primary"]},{"code":"VAL","name":"VAL","statuses":["primary"]},{"code":"XVC","name":"Vcash","statuses":["primary"]},{"code":"VCN","name":"VCN","statuses":["primary"]},{"code":"VEG","name":"VEG","statuses":["primary"]},{"code":"VENE","name":"VENE","statuses":["primary"]},{"code":"XVG","name":"Verge","statuses":["primary"]},{"code":"VRC","name":"VeriCoin","statuses":["primary"]},{"code":"VTC","name":"Vertcoin","statuses":["primary"]},{"code":"VIA","name":"Viacoin","statuses":["primary"]},{"code":"VIOR","name":"Viorcoin","statuses":["primary"]},{"code":"VIP","name":"VIP Tokens","statuses":["primary"]},{"code":"VIRAL","name":"Viral","statuses":["primary"]},{"code":"VOOT","name":"VootCoin","statuses":["primary"]},{"code":"VOX","name":"Voxels","statuses":["primary"]},{"code":"VOYA","name":"VOYA","statuses":["primary"]},{"code":"VPN","name":"VPNCoin","statuses":["primary"]},{"code":"VPRC","name":"VPRC","statuses":["primary"]},{"code":"VTA","name":"VTA","statuses":["primary"]},{"code":"VTN","name":"VTN","statuses":["primary"]},{"code":"VTR","name":"VTR","statuses":["primary"]},{"code":"WAC","name":"WAC","statuses":["primary"]},{"code":"WARP","name":"WARP","statuses":["primary"]},{"code":"WAVES","name":"WAVES","statuses":["primary"]},{"code":"WGC","name":"WGC","statuses":["primary"]},{"code":"XWC","name":"Whitecoin","statuses":["primary"]},{"code":"WBB","name":"Wild Beast Block","statuses":["primary"]},{"code":"WLC","name":"WLC","statuses":["primary"]},{"code":"WMC","name":"WMC","statuses":["primary"]},{"code":"LOG","name":"Woodcoin","statuses":["primary"]},{"code":"WOP","name":"WOP","statuses":["primary"]},{"code":"WDC","name":"Worldcoin","statuses":["primary"]},{"code":"XAB","name":"XAB","statuses":["primary"]},{"code":"XAI","name":"XAI","statuses":["primary"]},{"code":"XAU","name":"Xaurum","statuses":["primary"]},{"code":"XBS","name":"XBS","statuses":["primary"]},{"code":"XBU","name":"XBU","statuses":["primary"]},{"code":"XCO","name":"XCO","statuses":["primary"]},{"code":"XC","name":"XCurrency","statuses":["primary"]},{"code":"XDB","name":"XDB","statuses":["primary"]},{"code":"XEMP","name":"XEMP","statuses":["primary"]},{"code":"XFC","name":"XFC","statuses":["primary"]},{"code":"MI","name":"Xiaomicoin","statuses":["primary"]},{"code":"XID","name":"XID","statuses":["primary"]},{"code":"XJO","name":"XJO","statuses":["primary"]},{"code":"XLTCG","name":"XLTCG","statuses":["primary"]},{"code":"XMS","name":"XMS","statuses":["primary"]},{"code":"XNX","name":"XNX","statuses":["primary"]},{"code":"XPD","name":"XPD","statuses":["primary"]},{"code":"XPOKE","name":"XPOKE","statuses":["primary"]},{"code":"XPRO","name":"XPRO","statuses":["primary"]},{"code":"XQN","name":"XQN","statuses":["primary"]},{"code":"XSEED","name":"XSEED","statuses":["primary"]},{"code":"XSP","name":"XSP","statuses":["primary"]},{"code":"XT","name":"XT","statuses":["primary"]},{"code":"XTP","name":"XTP","statuses":["primary"]},{"code":"XUSD","name":"XUSD","statuses":["primary"]},{"code":"YACC","name":"YACC","statuses":["primary"]},{"code":"YAC","name":"Yacoin","statuses":["primary"]},{"code":"YAY","name":"YAY","statuses":["primary"]},{"code":"YBC","name":"Ybcoin","statuses":["primary"]},{"code":"YOC","name":"YOC","statuses":["primary"]},{"code":"YOVI","name":"YOVI","statuses":["primary"]},{"code":"YUM","name":"YUM","statuses":["primary"]},{"code":"ZCC","name":"ZCC","statuses":["primary"]},{"code":"ZEIT","name":"Zeitcoin","statuses":["primary"]},{"code":"ZET","name":"Zetacoin","statuses":["primary"]},{"code":"ZRC","name":"ZiftrCOIN","statuses":["primary"]},{"code":"ZMC","name":"ZMC","statuses":["primary"]},{"code":"ZNY","name":"ZNY","statuses":["primary"]},{"code":"ZS","name":"ZS","statuses":["primary"]}]} \ No newline at end of file -- cgit v1.2.3 From 637d3978b716a7f32cf603b70155d8db90509af2 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Tue, 9 Aug 2016 16:33:58 -0700 Subject: Fix default value. Add loading indication for async. --- app/scripts/metamask-controller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 45305ee8f..1550f0937 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -21,7 +21,7 @@ module.exports = class MetamaskController { this.idStore.setStore(this.ethStore) this.messageManager = messageManager this.publicConfigStore = this.initPublicConfigStore - this.configManager.setCurrentFiat('usd') + this.configManager.setCurrentFiat('USD') this.configManager.updateConversionRate() this.scheduleConversionInterval() } -- cgit v1.2.3 From cb0c1f25bacab5f6ee9348dbc3dc112f4d77560f Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Tue, 9 Aug 2016 16:49:15 -0700 Subject: Did not previously call functions before! --- app/scripts/metamask-controller.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'app') diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 1550f0937..b5052e438 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -252,9 +252,9 @@ module.exports = class MetamaskController { this.configManager.updateConversionRate() this.scheduleConversionInterval() const data = { - conversionRate: this.configManager.getConversionRate, - currentFiat: this.configManager.getCurrentFiat, - conversionDate: this.configManager.getConversionDate, + conversionRate: this.configManager.getConversionRate(), + currentFiat: this.configManager.getCurrentFiat(), + conversionDate: this.configManager.getConversionDate(), } cb(data) } catch (e) { -- cgit v1.2.3 From abfc5632efcc72b3ad45ec1df8bf5889f75a8472 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Wed, 10 Aug 2016 10:54:55 -0700 Subject: Fix ether warning checkbox. --- app/scripts/lib/config-manager.js | 8 ++++++-- app/scripts/metamask-controller.js | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'app') diff --git a/app/scripts/lib/config-manager.js b/app/scripts/lib/config-manager.js index 727cd46fc..3d84edfd0 100644 --- a/app/scripts/lib/config-manager.js +++ b/app/scripts/lib/config-manager.js @@ -274,9 +274,13 @@ ConfigManager.prototype.getConfirmed = function () { return ('isConfirmed' in data) && data.isConfirmed } -ConfigManager.prototype.setShouldntShowWarning = function (confirmed) { +ConfigManager.prototype.setShouldntShowWarning = function () { var data = this.getData() - data.isEthConfirmed = confirmed + if (data.isEthConfirmed) { + data.isEthConfirmed = !data.isEthConfirmed + } else { + data.isEthConfirmed = true + } this.setData(data) } diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index dd43ac2fc..e7e96a472 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -243,7 +243,7 @@ module.exports = class MetamaskController { agreeToEthWarning (cb) { try { - this.configManager.setShouldntShowWarning(true) + this.configManager.setShouldntShowWarning() cb() } catch (e) { cb(e) -- cgit v1.2.3 From 3417c421c8c5a73d363a724613145807bdbee354 Mon Sep 17 00:00:00 2001 From: kumavis Date: Thu, 11 Aug 2016 13:23:49 -0700 Subject: inpage-provider - remove createSyncProvider, just fail --- app/scripts/lib/inpage-provider.js | 43 +++----------------------------------- 1 file changed, 3 insertions(+), 40 deletions(-) (limited to 'app') diff --git a/app/scripts/lib/inpage-provider.js b/app/scripts/lib/inpage-provider.js index e387be895..5e8b240bc 100644 --- a/app/scripts/lib/inpage-provider.js +++ b/app/scripts/lib/inpage-provider.js @@ -1,9 +1,7 @@ -const HttpProvider = require('web3/lib/web3/httpprovider') const Streams = require('mississippi') const ObjectMultiplex = require('./obj-multiplex') const StreamProvider = require('web3-stream-provider') const RemoteStore = require('./remote-store.js').RemoteStore -const MetamaskConfig = require('../config.js') module.exports = MetamaskInpageProvider @@ -27,13 +25,6 @@ function MetamaskInpageProvider (connectionStream) { }) self.publicConfigStore = publicConfigStore - // connect to sync provider - self.syncProvider = createSyncProvider(publicConfigStore.get('provider')) - // subscribe to publicConfig to update the syncProvider on change - publicConfigStore.subscribe(function (state) { - self.syncProvider = createSyncProvider(state.provider) - }) - // connect to async provider var asyncProvider = new StreamProvider() Streams.pipe(asyncProvider, multiStream.createStream('provider'), asyncProvider, function (err) { @@ -65,9 +56,10 @@ MetamaskInpageProvider.prototype.send = function (payload) { result = selectedAddress || '0x0000000000000000000000000000000000000000' break - // fallback to normal rpc + // throw not-supported Error default: - return self.syncProvider.send(payload) + var message = 'The MetaMask Web3 object does not support synchronous methods. See https://github.com/MetaMask/faq#all-async---think-of-metamask-as-a-light-client for details.' + throw new Error(message) } @@ -89,35 +81,6 @@ MetamaskInpageProvider.prototype.isConnected = function () { // util -function createSyncProvider (providerConfig) { - providerConfig = providerConfig || {} - let syncProviderUrl - - if (providerConfig.rpcTarget) { - syncProviderUrl = providerConfig.rpcTarget - } else { - switch (providerConfig.type) { - case 'testnet': - syncProviderUrl = MetamaskConfig.network.testnet - break - case 'mainnet': - syncProviderUrl = MetamaskConfig.network.mainnet - break - default: - syncProviderUrl = MetamaskConfig.network.default - } - } - - const provider = new HttpProvider(syncProviderUrl) - // Stubbing out the send method to throw on sync methods: - provider.send = function() { - var message = 'The MetaMask Web3 object does not support synchronous methods. See https://github.com/MetaMask/faq#all-async---think-of-metamask-as-a-light-client for details.' - throw new Error(message) - } - - return provider -} - function remoteStoreWithLocalStorageCache (storageKey) { // read local cache var initState = JSON.parse(localStorage[storageKey] || '{}') -- cgit v1.2.3 From 53b1334d37c2792e76e2a114acb3e7b47399e8aa Mon Sep 17 00:00:00 2001 From: kumavis Date: Thu, 11 Aug 2016 13:31:00 -0700 Subject: clean -formatting --- app/scripts/lib/inpage-provider.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/scripts/lib/inpage-provider.js b/app/scripts/lib/inpage-provider.js index 5e8b240bc..e9e0ccf00 100644 --- a/app/scripts/lib/inpage-provider.js +++ b/app/scripts/lib/inpage-provider.js @@ -39,9 +39,9 @@ function MetamaskInpageProvider (connectionStream) { MetamaskInpageProvider.prototype.send = function (payload) { const self = this + let selectedAddress - - var result = null + let result = null switch (payload.method) { case 'eth_accounts': -- cgit v1.2.3 From 9904b4ef5a3d942c97e0585a9f1e4a5ddc7de8e6 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Thu, 11 Aug 2016 13:59:14 -0700 Subject: Add ability to hide logging messages in production. --- app/scripts/config.js | 3 ++- app/scripts/metamask-controller.js | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'app') diff --git a/app/scripts/config.js b/app/scripts/config.js index 5f6ffd936..297a3a7a0 100644 --- a/app/scripts/config.js +++ b/app/scripts/config.js @@ -2,6 +2,7 @@ const MAINET_RPC_URL = 'https://mainnet.infura.io/' const TESTNET_RPC_URL = 'https://morden.infura.io/' const DEFAULT_RPC_URL = TESTNET_RPC_URL const CLASSIC_RPC_URL = 'https://mainnet-nf.infura.io/' +const DEVELOPMENT_MODE = true module.exports = { network: { @@ -10,5 +11,5 @@ module.exports = { testnet: TESTNET_RPC_URL, classic: CLASSIC_RPC_URL, }, + developmentMode: DEVELOPMENT_MODE } - diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index dd43ac2fc..a5c167223 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -7,6 +7,7 @@ const HostStore = require('./lib/remote-store.js').HostStore const Web3 = require('web3') const ConfigManager = require('./lib/config-manager') const extension = require('./lib/extension') +const developmentMode = require('./config').developmentMode module.exports = class MetamaskController { @@ -93,7 +94,7 @@ module.exports = class MetamaskController { function logger (err, request, response) { if (err) return console.error(err) - if (!request.isMetamaskInternal) { + if (developmentMode && !request.isMetamaskInternal) { console.log(`RPC (${originDomain}):`, request, '->', response) if (response.error) { console.error('Error in RPC response:\n', response.error) @@ -218,7 +219,9 @@ module.exports = class MetamaskController { // Log blocks processBlock (block) { - console.log(`BLOCK CHANGED: #${block.number.toString('hex')} 0x${block.hash.toString('hex')}`) + if (developmentMode) { + console.log(`BLOCK CHANGED: #${block.number.toString('hex')} 0x${block.hash.toString('hex')}`) + } this.verifyNetwork() } -- cgit v1.2.3 From 804e8df87f6ccd4cad62c659022c00791a3921e9 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Thu, 11 Aug 2016 14:03:51 -0700 Subject: Lint --- app/scripts/config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/scripts/config.js b/app/scripts/config.js index 297a3a7a0..ce0ba7a01 100644 --- a/app/scripts/config.js +++ b/app/scripts/config.js @@ -11,5 +11,5 @@ module.exports = { testnet: TESTNET_RPC_URL, classic: CLASSIC_RPC_URL, }, - developmentMode: DEVELOPMENT_MODE + developmentMode: DEVELOPMENT_MODE, } -- cgit v1.2.3 From d7dffedf4825c468d32f389935fcac6e242a2232 Mon Sep 17 00:00:00 2001 From: kumavis Date: Thu, 11 Aug 2016 14:04:20 -0700 Subject: deps - local-message-stream extracted as module post-message-stream --- app/scripts/contentscript.js | 2 +- app/scripts/inpage.js | 2 +- app/scripts/lib/local-message-stream.js | 56 --------------------------------- 3 files changed, 2 insertions(+), 58 deletions(-) delete mode 100644 app/scripts/lib/local-message-stream.js (limited to 'app') diff --git a/app/scripts/contentscript.js b/app/scripts/contentscript.js index 1eb04059d..de2cf263b 100644 --- a/app/scripts/contentscript.js +++ b/app/scripts/contentscript.js @@ -1,4 +1,4 @@ -const LocalMessageDuplexStream = require('./lib/local-message-stream.js') +const LocalMessageDuplexStream = require('post-message-stream') const PortStream = require('./lib/port-stream.js') const ObjectMultiplex = require('./lib/obj-multiplex') const extension = require('./lib/extension') diff --git a/app/scripts/inpage.js b/app/scripts/inpage.js index 055235671..7c508c66f 100644 --- a/app/scripts/inpage.js +++ b/app/scripts/inpage.js @@ -1,7 +1,7 @@ /*global Web3*/ cleanContextForImports() require('web3/dist/web3.min.js') -const LocalMessageDuplexStream = require('./lib/local-message-stream.js') +const LocalMessageDuplexStream = require('post-message-stream') const setupDappAutoReload = require('./lib/auto-reload.js') const MetamaskInpageProvider = require('./lib/inpage-provider.js') restoreContextAfterImports() diff --git a/app/scripts/lib/local-message-stream.js b/app/scripts/lib/local-message-stream.js deleted file mode 100644 index 821e51046..000000000 --- a/app/scripts/lib/local-message-stream.js +++ /dev/null @@ -1,56 +0,0 @@ -const Duplex = require('readable-stream').Duplex -const inherits = require('util').inherits - -module.exports = LocalMessageDuplexStream - -inherits(LocalMessageDuplexStream, Duplex) - -function LocalMessageDuplexStream (opts) { - Duplex.call(this, { - objectMode: true, - }) - - // this._origin = opts.origin - this._name = opts.name - this._target = opts.target - - // console.log('LocalMessageDuplexStream ('+this._name+') - initialized...') - window.addEventListener('message', this._onMessage.bind(this), false) -} - -// private - -LocalMessageDuplexStream.prototype._onMessage = function (event) { - var msg = event.data - // console.log('LocalMessageDuplexStream ('+this._name+') - heard message...', event) - // validate message - if (event.origin !== location.origin) return // console.log('LocalMessageDuplexStream ('+this._name+') - rejected - (event.origin !== location.origin) ') - if (typeof msg !== 'object') return // console.log('LocalMessageDuplexStream ('+this._name+') - rejected - (typeof msg !== "object") ') - if (msg.target !== this._name) return // console.log('LocalMessageDuplexStream ('+this._name+') - rejected - (msg.target !== this._name) ', msg.target, this._name) - if (!msg.data) return // console.log('LocalMessageDuplexStream ('+this._name+') - rejected - (!msg.data) ') - // console.log('LocalMessageDuplexStream ('+this._name+') - accepted', msg.data) - // forward message - try { - this.push(msg.data) - } catch (err) { - this.emit('error', err) - } -} - -// stream plumbing - -LocalMessageDuplexStream.prototype._read = noop - -LocalMessageDuplexStream.prototype._write = function (data, encoding, cb) { - // console.log('LocalMessageDuplexStream ('+this._name+') - sending message...') - var message = { - target: this._target, - data: data, - } - window.postMessage(message, location.origin) - cb() -} - -// util - -function noop () {} -- cgit v1.2.3 From 243d83dd336de01644f3d4ec00f49aa22b641005 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Thu, 11 Aug 2016 14:24:35 -0700 Subject: Separate developmentMode conditional to only wrap log. --- app/scripts/metamask-controller.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index ac0f32117..269bc5afd 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -94,8 +94,10 @@ module.exports = class MetamaskController { function logger (err, request, response) { if (err) return console.error(err) - if (developmentMode && !request.isMetamaskInternal) { - console.log(`RPC (${originDomain}):`, request, '->', response) + if (!request.isMetamaskInternal) { + if (developmentMode) { + console.log(`RPC (${originDomain}):`, request, '->', response) + } if (response.error) { console.error('Error in RPC response:\n', response.error) } -- cgit v1.2.3 From c0f7c491055e3ab8d12efd78b9ff496ff292d74b Mon Sep 17 00:00:00 2001 From: kumavis Date: Thu, 11 Aug 2016 14:35:55 -0700 Subject: inpage-prov - sync error - fix link --- app/scripts/lib/inpage-provider.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/scripts/lib/inpage-provider.js b/app/scripts/lib/inpage-provider.js index e9e0ccf00..b3ed3d9e2 100644 --- a/app/scripts/lib/inpage-provider.js +++ b/app/scripts/lib/inpage-provider.js @@ -58,7 +58,7 @@ MetamaskInpageProvider.prototype.send = function (payload) { // throw not-supported Error default: - var message = 'The MetaMask Web3 object does not support synchronous methods. See https://github.com/MetaMask/faq#all-async---think-of-metamask-as-a-light-client for details.' + var message = 'The MetaMask Web3 object does not support synchronous methods. See https://github.com/MetaMask/faq/blob/master/DEVELOPERS.md#all-async---think-of-metamask-as-a-light-client for details.' throw new Error(message) } -- cgit v1.2.3 From b8856d765daeb9c3b5be9a3067f977d85222639c Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Thu, 11 Aug 2016 15:42:21 -0700 Subject: Setting defaults to production. --- app/scripts/config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/scripts/config.js b/app/scripts/config.js index ce0ba7a01..620872249 100644 --- a/app/scripts/config.js +++ b/app/scripts/config.js @@ -2,7 +2,7 @@ const MAINET_RPC_URL = 'https://mainnet.infura.io/' const TESTNET_RPC_URL = 'https://morden.infura.io/' const DEFAULT_RPC_URL = TESTNET_RPC_URL const CLASSIC_RPC_URL = 'https://mainnet-nf.infura.io/' -const DEVELOPMENT_MODE = true +const DEVELOPMENT_MODE = false module.exports = { network: { -- cgit v1.2.3 From 2b0c6953e27b937d8ff75aad00786e3501599a73 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Thu, 11 Aug 2016 18:58:23 -0700 Subject: Create global variable that changes ui logging. --- app/scripts/config.js | 2 -- app/scripts/metamask-controller.js | 9 ++------- 2 files changed, 2 insertions(+), 9 deletions(-) (limited to 'app') diff --git a/app/scripts/config.js b/app/scripts/config.js index 620872249..ba012c6b8 100644 --- a/app/scripts/config.js +++ b/app/scripts/config.js @@ -2,7 +2,6 @@ const MAINET_RPC_URL = 'https://mainnet.infura.io/' const TESTNET_RPC_URL = 'https://morden.infura.io/' const DEFAULT_RPC_URL = TESTNET_RPC_URL const CLASSIC_RPC_URL = 'https://mainnet-nf.infura.io/' -const DEVELOPMENT_MODE = false module.exports = { network: { @@ -11,5 +10,4 @@ module.exports = { testnet: TESTNET_RPC_URL, classic: CLASSIC_RPC_URL, }, - developmentMode: DEVELOPMENT_MODE, } diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 269bc5afd..e7e96a472 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -7,7 +7,6 @@ const HostStore = require('./lib/remote-store.js').HostStore const Web3 = require('web3') const ConfigManager = require('./lib/config-manager') const extension = require('./lib/extension') -const developmentMode = require('./config').developmentMode module.exports = class MetamaskController { @@ -95,9 +94,7 @@ module.exports = class MetamaskController { function logger (err, request, response) { if (err) return console.error(err) if (!request.isMetamaskInternal) { - if (developmentMode) { - console.log(`RPC (${originDomain}):`, request, '->', response) - } + console.log(`RPC (${originDomain}):`, request, '->', response) if (response.error) { console.error('Error in RPC response:\n', response.error) } @@ -221,9 +218,7 @@ module.exports = class MetamaskController { // Log blocks processBlock (block) { - if (developmentMode) { - console.log(`BLOCK CHANGED: #${block.number.toString('hex')} 0x${block.hash.toString('hex')}`) - } + console.log(`BLOCK CHANGED: #${block.number.toString('hex')} 0x${block.hash.toString('hex')}`) this.verifyNetwork() } -- cgit v1.2.3 From b1f68ec9cd2549a7b52272407f1543ae0b1d9326 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Thu, 11 Aug 2016 19:44:59 -0700 Subject: Add global var for background. --- app/scripts/background.js | 1 + app/scripts/config.js | 2 ++ app/scripts/lib/idStore.js | 9 ++++++--- app/scripts/metamask-controller.js | 8 ++++++-- 4 files changed, 15 insertions(+), 5 deletions(-) (limited to 'app') diff --git a/app/scripts/background.js b/app/scripts/background.js index 34c994ab7..e04309e74 100644 --- a/app/scripts/background.js +++ b/app/scripts/background.js @@ -13,6 +13,7 @@ const extension = require('./lib/extension') const STORAGE_KEY = 'metamask-config' + const controller = new MetamaskController({ // User confirmation callbacks: showUnconfirmedMessage, diff --git a/app/scripts/config.js b/app/scripts/config.js index ba012c6b8..7a1d54a3b 100644 --- a/app/scripts/config.js +++ b/app/scripts/config.js @@ -3,6 +3,8 @@ const TESTNET_RPC_URL = 'https://morden.infura.io/' const DEFAULT_RPC_URL = TESTNET_RPC_URL const CLASSIC_RPC_URL = 'https://mainnet-nf.infura.io/' +global.METAMASK_DEBUG = false + module.exports = { network: { default: DEFAULT_RPC_URL, diff --git a/app/scripts/lib/idStore.js b/app/scripts/lib/idStore.js index c6ac55a03..f63e03ec6 100644 --- a/app/scripts/lib/idStore.js +++ b/app/scripts/lib/idStore.js @@ -153,8 +153,9 @@ IdentityStore.prototype.getNetwork = function (err) { this._currentState.network = 'loading' return this._didUpdate() } - - console.log('web3.getNetwork returned ' + network) + if (global.METAMASK_DEBUG) { + console.log('web3.getNetwork returned ' + network) + } this._currentState.network = network this._didUpdate() }) @@ -475,7 +476,9 @@ IdentityStore.prototype._restoreFromSeed = function (password, seed, derivedKey) keyStore.generateNewAddress(derivedKey, 3) configManager.setWallet(keyStore.serialize()) - console.log('restored from seed. saved to keystore') + if (global.METAMASK_DEBUG) { + console.log('restored from seed. saved to keystore') + } return keyStore } diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index e7e96a472..2c141a402 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -94,7 +94,9 @@ module.exports = class MetamaskController { function logger (err, request, response) { if (err) return console.error(err) if (!request.isMetamaskInternal) { - console.log(`RPC (${originDomain}):`, request, '->', response) + if (global.METAMASK_DEBUG) { + console.log(`RPC (${originDomain}):`, request, '->', response) + } if (response.error) { console.error('Error in RPC response:\n', response.error) } @@ -218,7 +220,9 @@ module.exports = class MetamaskController { // Log blocks processBlock (block) { - console.log(`BLOCK CHANGED: #${block.number.toString('hex')} 0x${block.hash.toString('hex')}`) + if (global.METAMASK_DEBUG) { + console.log(`BLOCK CHANGED: #${block.number.toString('hex')} 0x${block.hash.toString('hex')}`) + } this.verifyNetwork() } -- cgit v1.2.3 From 0b660f4ac84e27967f96f3292f607aba9afc5ed8 Mon Sep 17 00:00:00 2001 From: kumavis Date: Fri, 12 Aug 2016 13:25:38 -0700 Subject: deps - extracted ensnare to module --- app/scripts/lib/auto-reload.js | 2 +- app/scripts/lib/ensnare.js | 24 ------------------------ 2 files changed, 1 insertion(+), 25 deletions(-) delete mode 100644 app/scripts/lib/ensnare.js (limited to 'app') diff --git a/app/scripts/lib/auto-reload.js b/app/scripts/lib/auto-reload.js index b45f02009..c4c8053f0 100644 --- a/app/scripts/lib/auto-reload.js +++ b/app/scripts/lib/auto-reload.js @@ -1,5 +1,5 @@ const once = require('once') -const ensnare = require('./ensnare.js') +const ensnare = require('ensnare') module.exports = setupDappAutoReload diff --git a/app/scripts/lib/ensnare.js b/app/scripts/lib/ensnare.js deleted file mode 100644 index 6100f7c79..000000000 --- a/app/scripts/lib/ensnare.js +++ /dev/null @@ -1,24 +0,0 @@ -module.exports = ensnare - -// creates a proxy object that calls cb everytime the obj's properties/fns are accessed -function ensnare (obj, cb) { - var proxy = {} - Object.keys(obj).forEach(function (key) { - var val = obj[key] - switch (typeof val) { - case 'function': - proxy[key] = function () { - cb() - val.apply(obj, arguments) - } - return - default: - Object.defineProperty(proxy, key, { - get: function () { cb(); return obj[key] }, - set: function (val) { cb(); obj[key] = val; return val }, - }) - return - } - }) - return proxy -} -- cgit v1.2.3 From e826eb932c918202bcf30d32d57464a4b860073b Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Sun, 14 Aug 2016 18:39:19 -0700 Subject: Remove ethereum classic provider Fixes #542 --- app/scripts/config.js | 2 -- app/scripts/lib/config-manager.js | 6 +----- 2 files changed, 1 insertion(+), 7 deletions(-) (limited to 'app') diff --git a/app/scripts/config.js b/app/scripts/config.js index 7a1d54a3b..04e2907d4 100644 --- a/app/scripts/config.js +++ b/app/scripts/config.js @@ -1,7 +1,6 @@ const MAINET_RPC_URL = 'https://mainnet.infura.io/' const TESTNET_RPC_URL = 'https://morden.infura.io/' const DEFAULT_RPC_URL = TESTNET_RPC_URL -const CLASSIC_RPC_URL = 'https://mainnet-nf.infura.io/' global.METAMASK_DEBUG = false @@ -10,6 +9,5 @@ module.exports = { default: DEFAULT_RPC_URL, mainnet: MAINET_RPC_URL, testnet: TESTNET_RPC_URL, - classic: CLASSIC_RPC_URL, }, } diff --git a/app/scripts/lib/config-manager.js b/app/scripts/lib/config-manager.js index 3d84edfd0..d14d3afc3 100644 --- a/app/scripts/lib/config-manager.js +++ b/app/scripts/lib/config-manager.js @@ -4,7 +4,6 @@ const migrations = require('./migrations') const TESTNET_RPC = MetamaskConfig.network.testnet const MAINNET_RPC = MetamaskConfig.network.mainnet -const CLASSIC_RPC = MetamaskConfig.network.classic /* The config-manager is a convenience object * wrapping a pojo-migrator. @@ -145,9 +144,6 @@ ConfigManager.prototype.getCurrentRpcAddress = function () { case 'testnet': return TESTNET_RPC - case 'classic': - return CLASSIC_RPC - default: return provider && provider.rpcTarget ? provider.rpcTarget : TESTNET_RPC } @@ -279,7 +275,7 @@ ConfigManager.prototype.setShouldntShowWarning = function () { if (data.isEthConfirmed) { data.isEthConfirmed = !data.isEthConfirmed } else { - data.isEthConfirmed = true + data.isEthConfirmed = true } this.setData(data) } -- cgit v1.2.3 From e5f2c1a866dfe246f2ec30df033d2f26a37fe0f8 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Mon, 15 Aug 2016 10:56:01 -0700 Subject: Version 2.8.0 --- app/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/manifest.json b/app/manifest.json index fa71742b1..a4953542e 100644 --- a/app/manifest.json +++ b/app/manifest.json @@ -1,7 +1,7 @@ { "name": "MetaMask", "short_name": "Metamask", - "version": "2.7.3", + "version": "2.8.0", "manifest_version": 2, "description": "Ethereum Browser Extension", "icons": { -- cgit v1.2.3 From 58e3042a3b105d9481cddc3f1c6253ccc6f19565 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Tue, 16 Aug 2016 13:21:16 -0700 Subject: Remove logging. Clean up duplicate entries in currency list. --- app/scripts/metamask-controller.js | 1 - 1 file changed, 1 deletion(-) (limited to 'app') diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 6dbc5e50e..d7f3df534 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -271,7 +271,6 @@ module.exports = class MetamaskController { clearInterval(this.conversionInterval) } this.conversionInterval = setInterval(() => { - console.log('started update conversion rate.') this.configManager.updateConversionRate() }, 300000) } -- cgit v1.2.3 From 6041ba1ed24b16ec2614c954b05ab03488301d72 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Tue, 16 Aug 2016 14:07:06 -0700 Subject: Add fallback to API failure. --- app/scripts/lib/config-manager.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'app') diff --git a/app/scripts/lib/config-manager.js b/app/scripts/lib/config-manager.js index f3164ec09..44617f0ed 100644 --- a/app/scripts/lib/config-manager.js +++ b/app/scripts/lib/config-manager.js @@ -291,6 +291,8 @@ ConfigManager.prototype.updateConversionRate = function () { this.setConversionDate(parsedResponse.timestamp) }).catch((err) => { console.error('Error in conversion.', err) + this.setConversionPrice('N/A') + this.setConversionDate('N/A') }) } -- cgit v1.2.3 From d43ac808ff3a0891fc3de5f370c3ebe1efbd86b2 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Tue, 16 Aug 2016 14:28:32 -0700 Subject: Fix uncalled fn. --- app/scripts/metamask-controller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index d7f3df534..d21eb5fc1 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -20,7 +20,7 @@ module.exports = class MetamaskController { this.ethStore = new EthStore(this.provider) this.idStore.setStore(this.ethStore) this.messageManager = messageManager - this.publicConfigStore = this.initPublicConfigStore + this.publicConfigStore = this.initPublicConfigStore() this.configManager.setCurrentFiat('USD') this.configManager.updateConversionRate() this.scheduleConversionInterval() -- cgit v1.2.3 From 666f3cd66ce56013e5688d514e3c1fc3ec8a6ac4 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Tue, 16 Aug 2016 15:11:40 -0700 Subject: Added compliance for tests and properly accounts for N/A conversions. --- app/scripts/lib/config-manager.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'app') diff --git a/app/scripts/lib/config-manager.js b/app/scripts/lib/config-manager.js index 44617f0ed..c56f52e48 100644 --- a/app/scripts/lib/config-manager.js +++ b/app/scripts/lib/config-manager.js @@ -291,7 +291,7 @@ ConfigManager.prototype.updateConversionRate = function () { this.setConversionDate(parsedResponse.timestamp) }).catch((err) => { console.error('Error in conversion.', err) - this.setConversionPrice('N/A') + this.setConversionPrice(0) this.setConversionDate('N/A') }) } @@ -310,12 +310,12 @@ ConfigManager.prototype.setConversionDate = function (datestring) { ConfigManager.prototype.getConversionRate = function () { var data = this.getData() - return ('conversionRate' in data) && data.conversionRate + return (('conversionRate' in data) && data.conversionRate) || 0 } ConfigManager.prototype.getConversionDate = function () { var data = this.getData() - return ('conversionDate' in data) && data.conversionDate + return (('conversionDate' in data) && data.conversionDate) || 'N/A' } ConfigManager.prototype.setShouldntShowWarning = function () { -- cgit v1.2.3 From 5479509618e601391586d0851acee4e408523c4f Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Tue, 16 Aug 2016 15:39:40 -0700 Subject: Set up MVP for popup-based notifications. --- app/notification.html | 11 ++++ app/scripts/background.js | 2 +- app/scripts/lib/notifications.js | 136 +++------------------------------------ app/scripts/notification.js | 85 ++++++++++++++++++++++++ 4 files changed, 106 insertions(+), 128 deletions(-) create mode 100644 app/notification.html create mode 100644 app/scripts/notification.js (limited to 'app') diff --git a/app/notification.html b/app/notification.html new file mode 100644 index 000000000..927f1634c --- /dev/null +++ b/app/notification.html @@ -0,0 +1,11 @@ + + + + + MetaMask Notification + + +
+ + + diff --git a/app/scripts/background.js b/app/scripts/background.js index e04309e74..79f8f9fd9 100644 --- a/app/scripts/background.js +++ b/app/scripts/background.js @@ -69,7 +69,7 @@ function showUnconfirmedTx (txParams, txData, onTxDoneCb) { extension.runtime.onConnect.addListener(connectRemote) function connectRemote (remotePort) { - var isMetaMaskInternalProcess = (remotePort.name === 'popup') + var isMetaMaskInternalProcess = remotePort.name === 'popup' || remotePort.name === 'notification' var portStream = new PortStream(remotePort) if (isMetaMaskInternalProcess) { // communication with popup diff --git a/app/scripts/lib/notifications.js b/app/scripts/lib/notifications.js index 6c1601df1..75fb60dd0 100644 --- a/app/scripts/lib/notifications.js +++ b/app/scripts/lib/notifications.js @@ -18,142 +18,24 @@ const notifications = { module.exports = notifications window.METAMASK_NOTIFIER = notifications -setupListeners() - -function setupListeners () { - // guard for extension bug https://github.com/MetaMask/metamask-plugin/issues/236 - if (!extension.notifications) return console.error('Chrome notifications API missing...') - - // notification button press - extension.notifications.onButtonClicked.addListener(function (notificationId, buttonIndex) { - var handlers = notificationHandlers[notificationId] - if (buttonIndex === 0) { - handlers.confirm() - } else { - handlers.cancel() - } - extension.notifications.clear(notificationId) - }) - - // notification teardown - extension.notifications.onClosed.addListener(function (notificationId) { - delete notificationHandlers[notificationId] - }) -} - -// creation helper function createUnlockRequestNotification (opts) { - // guard for extension bug https://github.com/MetaMask/metamask-plugin/issues/236 - if (!extension.notifications) return console.error('Chrome notifications API missing...') - var message = 'An Ethereum app has requested a signature. Please unlock your account.' - - var id = createId() - extension.notifications.create(id, { - type: 'basic', - iconUrl: '/images/icon-128.png', - title: opts.title, - message: message, - }) + showNotification() } function createTxNotification (state) { - // guard for extension bug https://github.com/MetaMask/metamask-plugin/issues/236 - if (!extension.notifications) return console.error('Chrome notifications API missing...') - - renderTxNotificationSVG(state, function (err, notificationSvgSource) { - if (err) throw err - - showNotification(extend(state, { - title: 'New Unsigned Transaction', - imageUrl: toSvgUri(notificationSvgSource), - })) - }) + showNotification() } function createMsgNotification (state) { - // guard for extension bug https://github.com/MetaMask/metamask-plugin/issues/236 - if (!extension.notifications) return console.error('Chrome notifications API missing...') - - renderMsgNotificationSVG(state, function (err, notificationSvgSource) { - if (err) throw err - - showNotification(extend(state, { - title: 'New Unsigned Message', - imageUrl: toSvgUri(notificationSvgSource), - })) - }) + showNotification() } -function showNotification (state) { - // guard for extension bug https://github.com/MetaMask/metamask-plugin/issues/236 - if (!extension.notifications) return console.error('Chrome notifications API missing...') - - var id = createId() - extension.notifications.create(id, { - type: 'image', - requireInteraction: true, - iconUrl: '/images/icon-128.png', - imageUrl: state.imageUrl, - title: state.title, - message: '', - buttons: [{ - title: 'Approve', - }, { - title: 'Reject', - }], +function showNotification() { + chrome.windows.create({ + url:"notification.html", + type:"panel", + width:360, + height:500, }) - notificationHandlers[id] = { - confirm: state.onConfirm, - cancel: state.onCancel, - } -} - -function renderTxNotificationSVG (state, cb) { - var content = h(PendingTxDetails, state) - renderNotificationSVG(content, cb) } -function renderMsgNotificationSVG (state, cb) { - var content = h(PendingMsgDetails, state) - renderNotificationSVG(content, cb) -} - -function renderNotificationSVG (content, cb) { - var container = document.createElement('div') - var confirmView = h('div.app-primary', { - style: { - width: '360px', - height: '240px', - padding: '16px', - // background: '#F7F7F7', - background: 'white', - }, - }, [ - h('style', MetaMaskUiCss()), - content, - ]) - - render(confirmView, container, function ready() { - var rootElement = findDOMNode(this) - var viewSource = rootElement.outerHTML - unmountComponentAtNode(container) - var svgSource = svgWrapper(viewSource) - // insert content into svg wrapper - cb(null, svgSource) - }) -} - -function svgWrapper (content) { - var wrapperSource = ` - - - {{content}} - - - ` - return wrapperSource.split('{{content}}').join(content) -} - -function toSvgUri (content) { - return 'data:image/svg+xml;utf8,' + encodeURIComponent(content) -} diff --git a/app/scripts/notification.js b/app/scripts/notification.js new file mode 100644 index 000000000..90c00b32d --- /dev/null +++ b/app/scripts/notification.js @@ -0,0 +1,85 @@ +const url = require('url') +const EventEmitter = require('events').EventEmitter +const async = require('async') +const Dnode = require('dnode') +const Web3 = require('web3') +const MetaMaskNotification = require('../../ui/notification') +const MetaMaskUiCss = require('../../ui/css') +const injectCss = require('inject-css') +const PortStream = require('./lib/port-stream.js') +const StreamProvider = require('web3-stream-provider') +const setupMultiplex = require('./lib/stream-utils.js').setupMultiplex +const extension = require('./lib/extension') + +// setup app +var css = MetaMaskUiCss() +injectCss(css) + +async.parallel({ + currentDomain: getCurrentDomain, + accountManager: connectToAccountManager, +}, setupApp) + +function connectToAccountManager (cb) { + // setup communication with background + var pluginPort = extension.runtime.connect({name: 'notification'}) + var portStream = new PortStream(pluginPort) + // setup multiplexing + var mx = setupMultiplex(portStream) + // connect features + setupControllerConnection(mx.createStream('controller'), cb) + setupWeb3Connection(mx.createStream('provider')) +} + +function setupWeb3Connection (stream) { + var remoteProvider = new StreamProvider() + remoteProvider.pipe(stream).pipe(remoteProvider) + stream.on('error', console.error.bind(console)) + remoteProvider.on('error', console.error.bind(console)) + global.web3 = new Web3(remoteProvider) +} + +function setupControllerConnection (stream, cb) { + var eventEmitter = new EventEmitter() + var background = Dnode({ + sendUpdate: function (state) { + eventEmitter.emit('update', state) + }, + }) + stream.pipe(background).pipe(stream) + background.once('remote', function (accountManager) { + // setup push events + accountManager.on = eventEmitter.on.bind(eventEmitter) + cb(null, accountManager) + }) +} + +function getCurrentDomain (cb) { + const unknown = '' + if (!extension.tabs) return cb(null, unknown) + extension.tabs.query({active: true, currentWindow: true}, function (results) { + var activeTab = results[0] + var currentUrl = activeTab && activeTab.url + var currentDomain = url.parse(currentUrl).host + if (!currentUrl) { + return cb(null, unknown) + } + cb(null, currentDomain) + }) +} + +function setupApp (err, opts) { + if (err) { + alert(err.stack) + throw err + } + + var container = document.getElementById('app-content') + + MetaMaskNotification({ + container: container, + accountManager: opts.accountManager, + currentDomain: opts.currentDomain, + networkVersion: opts.networkVersion, + }) +} -- cgit v1.2.3 From 030bdec27a95390207b9147c95b810893756db6d Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Tue, 16 Aug 2016 16:46:44 -0700 Subject: Unify notification and popup ui files --- app/notification.html | 7 ++++++- app/scripts/lib/extension-instance.js | 6 ++++++ app/scripts/lib/is-popup-or-notification.js | 8 ++++++++ app/scripts/lib/notifications.js | 2 +- app/scripts/popup.js | 7 ++++++- 5 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 app/scripts/lib/is-popup-or-notification.js (limited to 'app') diff --git a/app/notification.html b/app/notification.html index 927f1634c..cc485da7f 100644 --- a/app/notification.html +++ b/app/notification.html @@ -3,9 +3,14 @@ MetaMask Notification +
- + diff --git a/app/scripts/lib/extension-instance.js b/app/scripts/lib/extension-instance.js index eb3b8a1e9..d284895bc 100644 --- a/app/scripts/lib/extension-instance.js +++ b/app/scripts/lib/extension-instance.js @@ -41,6 +41,12 @@ function Extension () { } } catch (e) {} + try { + if (browser[api]) { + _this[api] = browser[api] + } + } + try { _this.api = browser.extension[api] } catch (e) {} diff --git a/app/scripts/lib/is-popup-or-notification.js b/app/scripts/lib/is-popup-or-notification.js new file mode 100644 index 000000000..5c38ac823 --- /dev/null +++ b/app/scripts/lib/is-popup-or-notification.js @@ -0,0 +1,8 @@ +module.exports = function isPopupOrNotification() { + const url = window.location.href + if (url.match(/popup.html$/)) { + return 'popup' + } else { + return 'notification' + } +} diff --git a/app/scripts/lib/notifications.js b/app/scripts/lib/notifications.js index 75fb60dd0..e6bdeff09 100644 --- a/app/scripts/lib/notifications.js +++ b/app/scripts/lib/notifications.js @@ -31,7 +31,7 @@ function createMsgNotification (state) { } function showNotification() { - chrome.windows.create({ + extension.windows.create({ url:"notification.html", type:"panel", width:360, diff --git a/app/scripts/popup.js b/app/scripts/popup.js index 20be15df7..4c729e227 100644 --- a/app/scripts/popup.js +++ b/app/scripts/popup.js @@ -9,6 +9,7 @@ const injectCss = require('inject-css') const PortStream = require('./lib/port-stream.js') const StreamProvider = require('web3-stream-provider') const setupMultiplex = require('./lib/stream-utils.js').setupMultiplex +const isPopupOrNotification = require('./lib/is-popup-or-notification') const extension = require('./lib/extension') // setup app @@ -22,7 +23,10 @@ async.parallel({ function connectToAccountManager (cb) { // setup communication with background - var pluginPort = extension.runtime.connect({name: 'popup'}) + + var name = isPopupOrNotification() + window.METAMASK_UI_TYPE = name + var pluginPort = extension.runtime.connect({ name }) var portStream = new PortStream(pluginPort) // setup multiplexing var mx = setupMultiplex(portStream) @@ -93,3 +97,4 @@ function setupApp (err, opts) { networkVersion: opts.networkVersion, }) } + -- cgit v1.2.3 From a167bbc5a0f29568ec8e53ecdd942724aa15604b Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Tue, 16 Aug 2016 17:32:54 -0700 Subject: MVP Popup Notifications Working I'm unsure which will be more performant: A notification using a trimmed down version of the UI, or using them both, letting the browser cache them both. In any case, here I've modified the normal UI to recognize when it's a popup, and change the UX accordingly in a few ways: - Hide the menu bar - Hide the back button from the notifications view. - When confirming the last tx, close the window. --- app/scripts/lib/extension-instance.js | 2 +- app/scripts/lib/notifications.js | 3 +- app/scripts/notification.js | 85 ----------------------------------- 3 files changed, 3 insertions(+), 87 deletions(-) delete mode 100644 app/scripts/notification.js (limited to 'app') diff --git a/app/scripts/lib/extension-instance.js b/app/scripts/lib/extension-instance.js index d284895bc..1098130e3 100644 --- a/app/scripts/lib/extension-instance.js +++ b/app/scripts/lib/extension-instance.js @@ -45,7 +45,7 @@ function Extension () { if (browser[api]) { _this[api] = browser[api] } - } + } catch (e) {} try { _this.api = browser.extension[api] diff --git a/app/scripts/lib/notifications.js b/app/scripts/lib/notifications.js index e6bdeff09..de9cf26e3 100644 --- a/app/scripts/lib/notifications.js +++ b/app/scripts/lib/notifications.js @@ -33,7 +33,8 @@ function createMsgNotification (state) { function showNotification() { extension.windows.create({ url:"notification.html", - type:"panel", + type:"detached_panel", + focused:true, width:360, height:500, }) diff --git a/app/scripts/notification.js b/app/scripts/notification.js deleted file mode 100644 index 90c00b32d..000000000 --- a/app/scripts/notification.js +++ /dev/null @@ -1,85 +0,0 @@ -const url = require('url') -const EventEmitter = require('events').EventEmitter -const async = require('async') -const Dnode = require('dnode') -const Web3 = require('web3') -const MetaMaskNotification = require('../../ui/notification') -const MetaMaskUiCss = require('../../ui/css') -const injectCss = require('inject-css') -const PortStream = require('./lib/port-stream.js') -const StreamProvider = require('web3-stream-provider') -const setupMultiplex = require('./lib/stream-utils.js').setupMultiplex -const extension = require('./lib/extension') - -// setup app -var css = MetaMaskUiCss() -injectCss(css) - -async.parallel({ - currentDomain: getCurrentDomain, - accountManager: connectToAccountManager, -}, setupApp) - -function connectToAccountManager (cb) { - // setup communication with background - var pluginPort = extension.runtime.connect({name: 'notification'}) - var portStream = new PortStream(pluginPort) - // setup multiplexing - var mx = setupMultiplex(portStream) - // connect features - setupControllerConnection(mx.createStream('controller'), cb) - setupWeb3Connection(mx.createStream('provider')) -} - -function setupWeb3Connection (stream) { - var remoteProvider = new StreamProvider() - remoteProvider.pipe(stream).pipe(remoteProvider) - stream.on('error', console.error.bind(console)) - remoteProvider.on('error', console.error.bind(console)) - global.web3 = new Web3(remoteProvider) -} - -function setupControllerConnection (stream, cb) { - var eventEmitter = new EventEmitter() - var background = Dnode({ - sendUpdate: function (state) { - eventEmitter.emit('update', state) - }, - }) - stream.pipe(background).pipe(stream) - background.once('remote', function (accountManager) { - // setup push events - accountManager.on = eventEmitter.on.bind(eventEmitter) - cb(null, accountManager) - }) -} - -function getCurrentDomain (cb) { - const unknown = '' - if (!extension.tabs) return cb(null, unknown) - extension.tabs.query({active: true, currentWindow: true}, function (results) { - var activeTab = results[0] - var currentUrl = activeTab && activeTab.url - var currentDomain = url.parse(currentUrl).host - if (!currentUrl) { - return cb(null, unknown) - } - cb(null, currentDomain) - }) -} - -function setupApp (err, opts) { - if (err) { - alert(err.stack) - throw err - } - - var container = document.getElementById('app-content') - - MetaMaskNotification({ - container: container, - accountManager: opts.accountManager, - currentDomain: opts.currentDomain, - networkVersion: opts.networkVersion, - }) -} -- cgit v1.2.3 From dfaac78e39ef1bd06e224ab56e493b4fa3201bef Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Tue, 16 Aug 2016 17:50:51 -0700 Subject: Linted --- app/scripts/lib/notifications.js | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) (limited to 'app') diff --git a/app/scripts/lib/notifications.js b/app/scripts/lib/notifications.js index de9cf26e3..d33db0ef9 100644 --- a/app/scripts/lib/notifications.js +++ b/app/scripts/lib/notifications.js @@ -1,14 +1,4 @@ -const createId = require('hat') -const extend = require('xtend') -const unmountComponentAtNode = require('react-dom').unmountComponentAtNode -const findDOMNode = require('react-dom').findDOMNode -const render = require('react-dom').render -const h = require('react-hyperscript') -const PendingTxDetails = require('../../../ui/app/components/pending-tx-details') -const PendingMsgDetails = require('../../../ui/app/components/pending-msg-details') -const MetaMaskUiCss = require('../../../ui/css') const extension = require('./extension') -var notificationHandlers = {} const notifications = { createUnlockRequestNotification: createUnlockRequestNotification, @@ -32,11 +22,11 @@ function createMsgNotification (state) { function showNotification() { extension.windows.create({ - url:"notification.html", - type:"detached_panel", - focused:true, - width:360, - height:500, + url: 'notification.html', + type: 'detached_panel', + focused: true, + width: 360, + height: 500, }) } -- cgit v1.2.3 From 752d16f6c072b0dd54eb245209881a25ff06cb8e Mon Sep 17 00:00:00 2001 From: Frankie Date: Thu, 18 Aug 2016 10:40:35 -0700 Subject: WIP: ShapeShift tx --- app/scripts/lib/config-manager.js | 33 +++++++++++++++++++++++++++++++++ app/scripts/lib/idStore.js | 1 + app/scripts/metamask-controller.js | 6 ++++++ 3 files changed, 40 insertions(+) (limited to 'app') diff --git a/app/scripts/lib/config-manager.js b/app/scripts/lib/config-manager.js index d14d3afc3..8e59d02f3 100644 --- a/app/scripts/lib/config-manager.js +++ b/app/scripts/lib/config-manager.js @@ -284,3 +284,36 @@ ConfigManager.prototype.getShouldntShowWarning = function () { var data = this.getData() return ('isEthConfirmed' in data) && data.isEthConfirmed } + +ConfigManager.prototype.getShapeShiftTxList = function () { + var data = this.getData() + var shapeShiftTxList = data.shapeShiftTxList ? data.shapeShiftTxList : [] + shapeShiftTxList.forEach((tx) => { + if (tx.response.status !== 'complete'){ + var requestListner = function (request) { + tx.response = JSON.parse(this.responseText) + if (tx.status === 'complete') { + tx.completeTime = new Date().getTime() + } + } + + var shapShiftReq = new XMLHttpRequest() + shapShiftReq.addEventListener('load', requestListner) + shapShiftReq.open('GET', `https://shapeshift.io/txStat/${tx.depositAddress}`, true) + shapShiftReq.send() + } + }) + return shapeShiftTxList +} + +ConfigManager.prototype.createShapeShiftTx = function (depositAddress, depositType) { + var data = this.getData() + + var shapeShiftTx = {depositAddress, depositType, key: 'shapeshift', time: new Date().getTime(), response: {}} + if(!data.shapeShiftTxList) { + data.shapeShiftTxList = [shapeShiftTx] + } else { + data.shapeShiftTxList.push(shapeShiftTx) + } + this.setData(data) +} diff --git a/app/scripts/lib/idStore.js b/app/scripts/lib/idStore.js index f63e03ec6..55d5e5e61 100644 --- a/app/scripts/lib/idStore.js +++ b/app/scripts/lib/idStore.js @@ -100,6 +100,7 @@ IdentityStore.prototype.getState = function () { unconfMsgs: messageManager.unconfirmedMsgs(), messages: messageManager.getMsgList(), selectedAddress: configManager.getSelectedAccount(), + shapeShiftTxList: configManager.getShapeShiftTxList(), })) } diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 2c141a402..d34f594d7 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -59,6 +59,8 @@ module.exports = class MetamaskController { recoverSeed: idStore.recoverSeed.bind(idStore), // coinbase buyEth: this.buyEth.bind(this), + // shapeshift + createShapeShiftTx : this.createShapeShiftTx.bind(this), } } @@ -287,6 +289,10 @@ module.exports = class MetamaskController { }) } + createShapeShiftTx (depositAddress, depositType) { + this.configManager.createShapeShiftTx(depositAddress, depositType) + } + } function noop () {} -- cgit v1.2.3 From 3525dc080110e7af1f9544e18b5646c87fb9ae95 Mon Sep 17 00:00:00 2001 From: Frankie Date: Thu, 18 Aug 2016 15:20:26 -0700 Subject: Create a ShapeShift tx in tx History --- app/scripts/lib/config-manager.js | 10 ++++++---- app/scripts/metamask-controller.js | 5 ++--- 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'app') diff --git a/app/scripts/lib/config-manager.js b/app/scripts/lib/config-manager.js index d6d10c8f2..6f5cb3a4a 100644 --- a/app/scripts/lib/config-manager.js +++ b/app/scripts/lib/config-manager.js @@ -337,11 +337,11 @@ ConfigManager.prototype.getShapeShiftTxList = function () { var data = this.getData() var shapeShiftTxList = data.shapeShiftTxList ? data.shapeShiftTxList : [] shapeShiftTxList.forEach((tx) => { - if (tx.response.status !== 'complete'){ + if (tx.response.status !== 'complete') { var requestListner = function (request) { tx.response = JSON.parse(this.responseText) - if (tx.status === 'complete') { - tx.completeTime = new Date().getTime() + if (tx.response.status === 'complete') { + tx.time = new Date().getTime() } } @@ -351,6 +351,7 @@ ConfigManager.prototype.getShapeShiftTxList = function () { shapShiftReq.send() } }) + this.setData(data) return shapeShiftTxList } @@ -358,10 +359,11 @@ ConfigManager.prototype.createShapeShiftTx = function (depositAddress, depositTy var data = this.getData() var shapeShiftTx = {depositAddress, depositType, key: 'shapeshift', time: new Date().getTime(), response: {}} - if(!data.shapeShiftTxList) { + if (!data.shapeShiftTxList) { data.shapeShiftTxList = [shapeShiftTx] } else { data.shapeShiftTxList.push(shapeShiftTx) } this.setData(data) } + diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 0b1d40148..218f1f72a 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -65,7 +65,7 @@ module.exports = class MetamaskController { // coinbase buyEth: this.buyEth.bind(this), // shapeshift - createShapeShiftTx : this.createShapeShiftTx.bind(this), + createShapeShiftTx: this.createShapeShiftTx.bind(this), } } @@ -319,10 +319,9 @@ module.exports = class MetamaskController { }) } - createShapeShiftTx (depositAddress, depositType) { + createShapeShiftTx (depositAddress, depositType) { this.configManager.createShapeShiftTx(depositAddress, depositType) } - } function noop () {} -- cgit v1.2.3 From 7389f9d0a0e1f798607ea8eea25583f8af854358 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Thu, 18 Aug 2016 15:40:56 -0700 Subject: Enforce tx history limit --- app/scripts/lib/config-manager.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'app') diff --git a/app/scripts/lib/config-manager.js b/app/scripts/lib/config-manager.js index c56f52e48..2ecdbb0c7 100644 --- a/app/scripts/lib/config-manager.js +++ b/app/scripts/lib/config-manager.js @@ -5,6 +5,7 @@ const rp = require('request-promise') const TESTNET_RPC = MetamaskConfig.network.testnet const MAINNET_RPC = MetamaskConfig.network.mainnet +const txLimit = 40 /* The config-manager is a convenience object * wrapping a pojo-migrator. @@ -15,6 +16,8 @@ const MAINNET_RPC = MetamaskConfig.network.mainnet */ module.exports = ConfigManager function ConfigManager (opts) { + this.txLimit = txLimit + // ConfigManager is observable and will emit updates this._subs = [] @@ -181,6 +184,9 @@ ConfigManager.prototype._saveTxList = function (txList) { ConfigManager.prototype.addTx = function (tx) { var transactions = this.getTxList() + while (transactions.length > this.txLimit - 1) { + transactions.shift() + } transactions.push(tx) this._saveTxList(transactions) } -- cgit v1.2.3 From 31e0a3491b3587d142fa478bd9ac5e4458becc45 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Mon, 22 Aug 2016 11:24:34 -0700 Subject: Version 2.9.0 --- app/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/manifest.json b/app/manifest.json index a4953542e..09bc9eb37 100644 --- a/app/manifest.json +++ b/app/manifest.json @@ -1,7 +1,7 @@ { "name": "MetaMask", "short_name": "Metamask", - "version": "2.8.0", + "version": "2.9.0", "manifest_version": 2, "description": "Ethereum Browser Extension", "icons": { -- cgit v1.2.3 From 18aef9570fe6c918673afea84483e54366317f6e Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Mon, 22 Aug 2016 14:07:02 -0700 Subject: Add spanish locales. --- app/_locales/es/messages.json | 10 ++++++++++ app/_locales/es_419/messages.json | 10 ++++++++++ 2 files changed, 20 insertions(+) create mode 100644 app/_locales/es/messages.json create mode 100644 app/_locales/es_419/messages.json (limited to 'app') diff --git a/app/_locales/es/messages.json b/app/_locales/es/messages.json new file mode 100644 index 000000000..78fc64dbf --- /dev/null +++ b/app/_locales/es/messages.json @@ -0,0 +1,10 @@ +{ + "appName": { + "message": "MetaMask", + "description": "The name of the application" + }, + "appDescription": { + "message": "Administración de identidad en Ethereum", + "description": "The description of the application" + } +} diff --git a/app/_locales/es_419/messages.json b/app/_locales/es_419/messages.json new file mode 100644 index 000000000..78fc64dbf --- /dev/null +++ b/app/_locales/es_419/messages.json @@ -0,0 +1,10 @@ +{ + "appName": { + "message": "MetaMask", + "description": "The name of the application" + }, + "appDescription": { + "message": "Administración de identidad en Ethereum", + "description": "The description of the application" + } +} -- cgit v1.2.3 From bc2abd0a78a1ac43d230290dbb62c63c68c012ea Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Mon, 22 Aug 2016 14:11:32 -0700 Subject: First part of chinese translation. --- app/_locales/zh_CN/messages.json | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 app/_locales/zh_CN/messages.json (limited to 'app') diff --git a/app/_locales/zh_CN/messages.json b/app/_locales/zh_CN/messages.json new file mode 100644 index 000000000..fc87384e5 --- /dev/null +++ b/app/_locales/zh_CN/messages.json @@ -0,0 +1,10 @@ +{ + "appName": { + "message": "MetaMask", + "description": "The name of the application" + }, + "appDescription": { + "message": "以太坊身份管理", + "description": "The description of the application" + } +} -- cgit v1.2.3 From 361e26fad779dc35e480cf5333b6237f437732a5 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Mon, 22 Aug 2016 17:18:14 -0700 Subject: Limit to one popup, re-focus on additional notifications. --- app/scripts/lib/notifications.js | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'app') diff --git a/app/scripts/lib/notifications.js b/app/scripts/lib/notifications.js index d33db0ef9..278c7674e 100644 --- a/app/scripts/lib/notifications.js +++ b/app/scripts/lib/notifications.js @@ -21,12 +21,23 @@ function createMsgNotification (state) { } function showNotification() { - extension.windows.create({ - url: 'notification.html', - type: 'detached_panel', - focused: true, - width: 360, - height: 500, + extension.windows.getAll({}, (windows) => { + + let popupWindow = windows.find((win) => { + return win.type === 'popup' + }) + + if (popupWindow) { + return extension.windows.update(popupWindow.id, { focused: true }) + } + + extension.windows.create({ + url: 'notification.html', + type: 'detached_panel', + focused: true, + width: 360, + height: 500, + }) }) } -- cgit v1.2.3 From b8077983d6ecfeab8998006f188207b8b3f4d6d1 Mon Sep 17 00:00:00 2001 From: kumavis Date: Mon, 22 Aug 2016 18:59:15 -0700 Subject: inpage provider - reassign incomming ids --- app/scripts/lib/inpage-provider.js | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/scripts/lib/inpage-provider.js b/app/scripts/lib/inpage-provider.js index b3ed3d9e2..65354cd3d 100644 --- a/app/scripts/lib/inpage-provider.js +++ b/app/scripts/lib/inpage-provider.js @@ -33,8 +33,16 @@ function MetamaskInpageProvider (connectionStream) { }) asyncProvider.on('error', console.error.bind(console)) self.asyncProvider = asyncProvider - // overwrite own sendAsync method - self.sendAsync = asyncProvider.sendAsync.bind(asyncProvider) + // handle sendAsync requests via asyncProvider + self.sendAsync = function(payload, cb){ + // rewrite request ids + var request = jsonrpcMessageTransform(payload, (message) => { + message.id = createRandomId() + return message + }) + // forward to asyncProvider + asyncProvider.sendAsync(request, cb) + } } MetamaskInpageProvider.prototype.send = function (payload) { @@ -92,3 +100,21 @@ function remoteStoreWithLocalStorageCache (storageKey) { return store } + +function createRandomId(){ + const extraDigits = 3 + // 13 time digits + const datePart = new Date().getTime() * Math.pow(10, extraDigits) + // 3 random digits + const extraPart = Math.floor(Math.random() * Math.pow(10, extraDigits)) + // 16 digits + return datePart + extraPart +} + +function jsonrpcMessageTransform(payload, transformFn){ + if (Array.isArray(payload)) { + return payload.map(transformFn) + } else { + return transformFn(payload) + } +} \ No newline at end of file -- cgit v1.2.3 From 8b9999b71eab07187e2723aadcc8163140985301 Mon Sep 17 00:00:00 2001 From: kumavis Date: Mon, 22 Aug 2016 19:22:12 -0700 Subject: inpage - cleanContextForImports fix set to undefined instead of deleting updates #447 --- app/scripts/inpage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/scripts/inpage.js b/app/scripts/inpage.js index 7c508c66f..28a1223ac 100644 --- a/app/scripts/inpage.js +++ b/app/scripts/inpage.js @@ -54,7 +54,7 @@ var __define function cleanContextForImports () { __define = global.define try { - delete global.define + global.define = undefined } catch (_) { console.warn('MetaMask - global.define could not be deleted.') } -- cgit v1.2.3 From e5ca83d2bf7e97131e20da0ad352a38c7f8a2f86 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Tue, 23 Aug 2016 11:15:56 -0700 Subject: Emit updates to all listeners on pending tx updates Previously the metamask controller only supported a single UI event listener, which wasn't useful for having a separate notification UI open at the same time. Also reduced the notification's complexity down to a single method, which is heavily re-used. Still has an outstanding bug where if the plugin ui dismisses the last tx, it does not close the notification popup. --- app/scripts/background.js | 38 +++++--------------------------------- app/scripts/lib/notifications.js | 16 +--------------- app/scripts/metamask-controller.js | 22 +++++++++++++++++----- 3 files changed, 23 insertions(+), 53 deletions(-) (limited to 'app') diff --git a/app/scripts/background.js b/app/scripts/background.js index 79f8f9fd9..9a324047b 100644 --- a/app/scripts/background.js +++ b/app/scripts/background.js @@ -3,9 +3,7 @@ const extend = require('xtend') const Dnode = require('dnode') const eos = require('end-of-stream') const PortStream = require('./lib/port-stream.js') -const createUnlockRequestNotification = require('./lib/notifications.js').createUnlockRequestNotification -const createTxNotification = require('./lib/notifications.js').createTxNotification -const createMsgNotification = require('./lib/notifications.js').createMsgNotification +const notification = require('./lib/notifications.js') const messageManager = require('./lib/message-manager') const setupMultiplex = require('./lib/stream-utils.js').setupMultiplex const MetamaskController = require('./metamask-controller') @@ -26,41 +24,15 @@ const controller = new MetamaskController({ const idStore = controller.idStore function unlockAccountMessage () { - createUnlockRequestNotification({ - title: 'Account Unlock Request', - }) + notification.show() } function showUnconfirmedMessage (msgParams, msgId) { - var controllerState = controller.getState() - - createMsgNotification({ - imageifyIdenticons: false, - txData: { - msgParams: msgParams, - time: (new Date()).getTime(), - }, - identities: controllerState.identities, - accounts: controllerState.accounts, - onConfirm: idStore.approveMessage.bind(idStore, msgId, noop), - onCancel: idStore.cancelMessage.bind(idStore, msgId), - }) + notification.show() } function showUnconfirmedTx (txParams, txData, onTxDoneCb) { - var controllerState = controller.getState() - - createTxNotification({ - imageifyIdenticons: false, - txData: { - txParams: txParams, - time: (new Date()).getTime(), - }, - identities: controllerState.identities, - accounts: controllerState.accounts, - onConfirm: idStore.approveTransaction.bind(idStore, txData.id, noop), - onCancel: idStore.cancelTransaction.bind(idStore, txData.id), - }) + notification.show() } // @@ -109,7 +81,7 @@ function setupControllerConnection (stream) { dnode.on('remote', (remote) => { // push updates to popup controller.ethStore.on('update', controller.sendUpdate.bind(controller)) - controller.remote = remote + controller.listeners.push(remote) idStore.on('update', controller.sendUpdate.bind(controller)) // teardown on disconnect diff --git a/app/scripts/lib/notifications.js b/app/scripts/lib/notifications.js index 278c7674e..4c2aa91de 100644 --- a/app/scripts/lib/notifications.js +++ b/app/scripts/lib/notifications.js @@ -1,25 +1,11 @@ const extension = require('./extension') const notifications = { - createUnlockRequestNotification: createUnlockRequestNotification, - createTxNotification: createTxNotification, - createMsgNotification: createMsgNotification, + show: showNotification, } module.exports = notifications window.METAMASK_NOTIFIER = notifications -function createUnlockRequestNotification (opts) { - showNotification() -} - -function createTxNotification (state) { - showNotification() -} - -function createMsgNotification (state) { - showNotification() -} - function showNotification() { extension.windows.getAll({}, (windows) => { diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 218f1f72a..81b232730 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -12,6 +12,7 @@ module.exports = class MetamaskController { constructor (opts) { this.opts = opts + this.listeners = [] this.configManager = new ConfigManager(opts) this.idStore = new IdentityStore({ configManager: this.configManager, @@ -112,9 +113,9 @@ module.exports = class MetamaskController { } sendUpdate () { - if (this.remote) { - this.remote.sendUpdate(this.getState()) - } + this.listeners.forEach((remote) => { + remote.sendUpdate(this.getState()) + }) } initializeProvider (opts) { @@ -130,10 +131,17 @@ module.exports = class MetamaskController { }, // tx signing approveTransaction: this.newUnsignedTransaction.bind(this), - signTransaction: idStore.signTransaction.bind(idStore), + signTransaction: (...args) => { + idStore.signTransaction(...args) + this.sendUpdate() + }, + // msg signing approveMessage: this.newUnsignedMessage.bind(this), - signMessage: idStore.signMessage.bind(idStore), + signMessage: (...args) => { + idStore.signMessage(...args) + this.sendUpdate() + }, } var provider = MetaMaskProvider(providerOpts) @@ -193,6 +201,8 @@ module.exports = class MetamaskController { // It's locked if (!state.isUnlocked) { + + // Allow the environment to define an unlock message. this.opts.unlockAccountMessage() idStore.addUnconfirmedTransaction(txParams, onTxDoneCb, noop) @@ -200,6 +210,7 @@ module.exports = class MetamaskController { } else { idStore.addUnconfirmedTransaction(txParams, onTxDoneCb, (err, txData) => { if (err) return onTxDoneCb(err) + this.sendUpdate() this.opts.showUnconfirmedTx(txParams, txData, onTxDoneCb) }) } @@ -211,6 +222,7 @@ module.exports = class MetamaskController { this.opts.unlockAccountMessage() } else { this.addUnconfirmedMessage(msgParams, cb) + this.sendUpdate() } } -- cgit v1.2.3 From 4fb49dfb4b3f23a5510c5a958671e9454d214a11 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Tue, 23 Aug 2016 11:40:08 -0700 Subject: Close popup even if last tx is dismissed from main UI --- app/scripts/lib/notifications.js | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'app') diff --git a/app/scripts/lib/notifications.js b/app/scripts/lib/notifications.js index 4c2aa91de..cf4e1c216 100644 --- a/app/scripts/lib/notifications.js +++ b/app/scripts/lib/notifications.js @@ -2,19 +2,15 @@ const extension = require('./extension') const notifications = { show: showNotification, + getPopup, } module.exports = notifications window.METAMASK_NOTIFIER = notifications function showNotification() { - extension.windows.getAll({}, (windows) => { - - let popupWindow = windows.find((win) => { - return win.type === 'popup' - }) - - if (popupWindow) { - return extension.windows.update(popupWindow.id, { focused: true }) + getPopup((popup) => { + if (popup) { + return extension.windows.update(popup.id, { focused: true }) } extension.windows.create({ @@ -27,3 +23,13 @@ function showNotification() { }) } +function getPopup(cb) { + extension.windows.getAll({}, (windows) => { + let popup = windows.find((win) => { + return win.type === 'popup' + }) + + cb(popup) + }) +} + -- cgit v1.2.3 From 983f3938daf7e8f718faed94b0b76054182719a3 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Tue, 23 Aug 2016 11:42:54 -0700 Subject: Linted --- app/scripts/background.js | 1 - 1 file changed, 1 deletion(-) (limited to 'app') diff --git a/app/scripts/background.js b/app/scripts/background.js index 9a324047b..5dae8235f 100644 --- a/app/scripts/background.js +++ b/app/scripts/background.js @@ -161,4 +161,3 @@ function setData (data) { window.localStorage[STORAGE_KEY] = JSON.stringify(data) } -function noop () {} -- cgit v1.2.3 From b3887ffd0a33096ef63fd4bbba9b5ff559775b3e Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Tue, 23 Aug 2016 11:48:46 -0700 Subject: Skip popup dismissal in tests --- app/scripts/lib/notifications.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'app') diff --git a/app/scripts/lib/notifications.js b/app/scripts/lib/notifications.js index cf4e1c216..c8ecad805 100644 --- a/app/scripts/lib/notifications.js +++ b/app/scripts/lib/notifications.js @@ -24,6 +24,12 @@ function showNotification() { } function getPopup(cb) { + + // Ignore in test environment + if (!extension.windows) { + return cb(null) + } + extension.windows.getAll({}, (windows) => { let popup = windows.find((win) => { return win.type === 'popup' -- cgit v1.2.3 From 5168232481849019d00756139b3cfc7b6a93a1f3 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Tue, 23 Aug 2016 14:11:25 -0700 Subject: Created option to pass in static file for fallback for logo. --- app/images/icon-512.png | Bin 0 -> 42078 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 app/images/icon-512.png (limited to 'app') diff --git a/app/images/icon-512.png b/app/images/icon-512.png new file mode 100644 index 000000000..9c0d1384d Binary files /dev/null and b/app/images/icon-512.png differ -- cgit v1.2.3 From 671ca33abb93fafeb55a18543e81942c5963da8e Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Tue, 23 Aug 2016 15:44:50 -0700 Subject: Close notification on opening main UI --- app/scripts/lib/notifications.js | 11 +++++++++-- app/scripts/popup.js | 7 +++++++ 2 files changed, 16 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/scripts/lib/notifications.js b/app/scripts/lib/notifications.js index c8ecad805..dcb946845 100644 --- a/app/scripts/lib/notifications.js +++ b/app/scripts/lib/notifications.js @@ -1,13 +1,14 @@ const extension = require('./extension') const notifications = { - show: showNotification, + show, getPopup, + closePopup, } module.exports = notifications window.METAMASK_NOTIFIER = notifications -function showNotification() { +function show () { getPopup((popup) => { if (popup) { return extension.windows.update(popup.id, { focused: true }) @@ -39,3 +40,9 @@ function getPopup(cb) { }) } +function closePopup() { + getPopup((popup) => { + if (!popup) return + extension.windows.remove(popup.id, console.error) + }) +} diff --git a/app/scripts/popup.js b/app/scripts/popup.js index 4c729e227..90b90a7af 100644 --- a/app/scripts/popup.js +++ b/app/scripts/popup.js @@ -11,6 +11,7 @@ const StreamProvider = require('web3-stream-provider') const setupMultiplex = require('./lib/stream-utils.js').setupMultiplex const isPopupOrNotification = require('./lib/is-popup-or-notification') const extension = require('./lib/extension') +const notification = require('./lib/notifications') // setup app var css = MetaMaskUiCss() @@ -25,6 +26,7 @@ function connectToAccountManager (cb) { // setup communication with background var name = isPopupOrNotification() + closePopupIfOpen(name) window.METAMASK_UI_TYPE = name var pluginPort = extension.runtime.connect({ name }) var portStream = new PortStream(pluginPort) @@ -98,3 +100,8 @@ function setupApp (err, opts) { }) } +function closePopupIfOpen(name) { + if (name !== 'notification') { + notification.closePopup() + } +} -- cgit v1.2.3 From 9328e96d8084b8bd6bc8e6486809da94883754a5 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Tue, 23 Aug 2016 16:53:05 -0700 Subject: Add shortcut for opening MetaMask. --- app/manifest.json | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'app') diff --git a/app/manifest.json b/app/manifest.json index 09bc9eb37..99879eed3 100644 --- a/app/manifest.json +++ b/app/manifest.json @@ -4,6 +4,16 @@ "version": "2.9.0", "manifest_version": 2, "description": "Ethereum Browser Extension", + "commands": { + "_execute_browser_action": { + "suggested_key": { + "windows": "Ctrl+M", + "mac": "Command+M", + "chromeos": "Ctrl+M", + "linux": "Ctrl+M" + } + } + }, "icons": { "16": "images/icon-16.png", "128": "images/icon-128.png" -- cgit v1.2.3 From 1444f5451fc78b3cb74a6f54ed18ccec129f0988 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Wed, 24 Aug 2016 10:25:59 -0700 Subject: Change shortcut to Alt+M --- app/manifest.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'app') diff --git a/app/manifest.json b/app/manifest.json index 99879eed3..cd471728b 100644 --- a/app/manifest.json +++ b/app/manifest.json @@ -7,10 +7,10 @@ "commands": { "_execute_browser_action": { "suggested_key": { - "windows": "Ctrl+M", - "mac": "Command+M", - "chromeos": "Ctrl+M", - "linux": "Ctrl+M" + "windows": "Alt+M", + "mac": "Alt+M", + "chromeos": "Alt+M", + "linux": "Alt+M" } } }, -- cgit v1.2.3 From cf5b8ba3882cbe7537eddc4ea3ad6495cec1ad75 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Wed, 24 Aug 2016 11:15:03 -0700 Subject: Change shortcut again to Ctrl+Alt+M --- app/manifest.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'app') diff --git a/app/manifest.json b/app/manifest.json index cd471728b..c1b9ee817 100644 --- a/app/manifest.json +++ b/app/manifest.json @@ -7,10 +7,10 @@ "commands": { "_execute_browser_action": { "suggested_key": { - "windows": "Alt+M", - "mac": "Alt+M", - "chromeos": "Alt+M", - "linux": "Alt+M" + "windows": "Ctrl+Alt+M", + "mac": "Command+Alt+M", + "chromeos": "Ctrl+Alt+M", + "linux": "Ctrl+Alt+M" } } }, -- cgit v1.2.3 From d3d634d09c0c51ade2d750ee2d7f036f797757b0 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Wed, 24 Aug 2016 13:28:06 -0700 Subject: Added mock option to function. --- app/scripts/lib/config-manager.js | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) (limited to 'app') diff --git a/app/scripts/lib/config-manager.js b/app/scripts/lib/config-manager.js index 4d270bcdb..a37447fa2 100644 --- a/app/scripts/lib/config-manager.js +++ b/app/scripts/lib/config-manager.js @@ -288,21 +288,32 @@ ConfigManager.prototype.getCurrentFiat = function () { return ('fiatCurrency' in data) && data.fiatCurrency } -ConfigManager.prototype.updateConversionRate = function () { +ConfigManager.prototype.updateConversionRate = function (mock = false, mockCurrency = 'USD') { var data = this.getData() - return rp(`https://www.cryptonator.com/api/ticker/eth-${data.fiatCurrency}`) - .then((response) => { - const parsedResponse = JSON.parse(response) - this.setConversionPrice(parsedResponse.ticker.price) - this.setConversionDate(parsedResponse.timestamp) - }).catch((err) => { - console.error('Error in conversion.', err) - this.setConversionPrice(0) - this.setConversionDate('N/A') - }) + if (!mock) { + return rp(`https://www.cryptonator.com/api/ticker/eth-${data.fiatCurrency}`) + .then((response) => { + const parsedResponse = JSON.parse(response) + this.setConversionPrice(parsedResponse.ticker.price) + this.setConversionDate(parsedResponse.timestamp) + }).catch((err) => { + console.error('Error in conversion.', err) + this.setConversionPrice(0) + this.setConversionDate('N/A') + }) + } else { + return new Promise(function(resolve, reject) { resolve() }).then((response) => { + this.setConversionPrice('11.01') + this.setConversionDate(1472065924) + }).catch((err) => { + console.error('Error in conversion.', err) + this.setConversionPrice('11.01') + this.setConversionDate(1472065924) + }) + } } -ConfigManager.prototype.setConversionPrice = function(price) { +ConfigManager.prototype.setConversionPrice = function (price) { var data = this.getData() data.conversionRate = Number(price) this.setData(data) @@ -372,4 +383,3 @@ ConfigManager.prototype.createShapeShiftTx = function (depositAddress, depositTy } this.setData(data) } - -- cgit v1.2.3 From c82a494b4bc3bd12da52356119698cc380128669 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Wed, 24 Aug 2016 13:58:50 -0700 Subject: Implement usage of nock. --- app/scripts/lib/config-manager.js | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-) (limited to 'app') diff --git a/app/scripts/lib/config-manager.js b/app/scripts/lib/config-manager.js index a37447fa2..715efb42e 100644 --- a/app/scripts/lib/config-manager.js +++ b/app/scripts/lib/config-manager.js @@ -288,29 +288,19 @@ ConfigManager.prototype.getCurrentFiat = function () { return ('fiatCurrency' in data) && data.fiatCurrency } -ConfigManager.prototype.updateConversionRate = function (mock = false, mockCurrency = 'USD') { +ConfigManager.prototype.updateConversionRate = function () { var data = this.getData() - if (!mock) { - return rp(`https://www.cryptonator.com/api/ticker/eth-${data.fiatCurrency}`) - .then((response) => { - const parsedResponse = JSON.parse(response) - this.setConversionPrice(parsedResponse.ticker.price) - this.setConversionDate(parsedResponse.timestamp) - }).catch((err) => { - console.error('Error in conversion.', err) - this.setConversionPrice(0) - this.setConversionDate('N/A') - }) - } else { - return new Promise(function(resolve, reject) { resolve() }).then((response) => { - this.setConversionPrice('11.01') - this.setConversionDate(1472065924) - }).catch((err) => { - console.error('Error in conversion.', err) - this.setConversionPrice('11.01') - this.setConversionDate(1472065924) - }) - } + return rp(`https://www.cryptonator.com/api/ticker/eth-${data.fiatCurrency}`) + .then((response) => { + const parsedResponse = JSON.parse(response) + this.setConversionPrice(parsedResponse.ticker.price) + this.setConversionDate(parsedResponse.timestamp) + }).catch((err) => { + console.error('Error in conversion.', err) + this.setConversionPrice(0) + this.setConversionDate('N/A') + }) + } ConfigManager.prototype.setConversionPrice = function (price) { -- cgit v1.2.3 From abb5b2013d0a1f4201537413aab877f4b74ce10e Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Wed, 24 Aug 2016 15:58:08 -0700 Subject: Fix bug where unconfirmed message sig is lost when locked. Fixes #484 Adds unsigned messages to the in-memory message list before showing the unlock message. --- app/scripts/metamask-controller.js | 1 + 1 file changed, 1 insertion(+) (limited to 'app') diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 218f1f72a..18f6499d9 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -208,6 +208,7 @@ module.exports = class MetamaskController { newUnsignedMessage (msgParams, cb) { var state = this.idStore.getState() if (!state.isUnlocked) { + idStore.addUnconfirmedMessage(msgParams, cb) this.opts.unlockAccountMessage() } else { this.addUnconfirmedMessage(msgParams, cb) -- cgit v1.2.3 From 3febbdae57be49ee41bdb70af73ffd374317cb2e Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Wed, 24 Aug 2016 16:02:22 -0700 Subject: Linted --- app/scripts/metamask-controller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 18f6499d9..d53094e43 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -208,7 +208,7 @@ module.exports = class MetamaskController { newUnsignedMessage (msgParams, cb) { var state = this.idStore.getState() if (!state.isUnlocked) { - idStore.addUnconfirmedMessage(msgParams, cb) + this.idStore.addUnconfirmedMessage(msgParams, cb) this.opts.unlockAccountMessage() } else { this.addUnconfirmedMessage(msgParams, cb) -- cgit v1.2.3 From 340d12f0cfd413929e248a7759585be52227c762 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Wed, 24 Aug 2016 16:32:15 -0700 Subject: Version 2.9.1 --- app/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/manifest.json b/app/manifest.json index c1b9ee817..96b5879e2 100644 --- a/app/manifest.json +++ b/app/manifest.json @@ -1,7 +1,7 @@ { "name": "MetaMask", "short_name": "Metamask", - "version": "2.9.0", + "version": "2.9.1", "manifest_version": 2, "description": "Ethereum Browser Extension", "commands": { -- cgit v1.2.3 From 8dfa701197c57d65262b285f009c612d065b0f16 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Wed, 24 Aug 2016 18:33:27 -0700 Subject: Fixed prohibited shortcut combination. --- app/manifest.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'app') diff --git a/app/manifest.json b/app/manifest.json index c1b9ee817..5bfd15f66 100644 --- a/app/manifest.json +++ b/app/manifest.json @@ -7,10 +7,10 @@ "commands": { "_execute_browser_action": { "suggested_key": { - "windows": "Ctrl+Alt+M", - "mac": "Command+Alt+M", - "chromeos": "Ctrl+Alt+M", - "linux": "Ctrl+Alt+M" + "windows": "Alt+Shift+M", + "mac": "Alt+Shift+M", + "chromeos": "Search+M", + "linux": "Alt+Shift+M" } } }, -- cgit v1.2.3 From a9b390c58c5fe3abe92ed3d33fd4d8cb74ff3cce Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Wed, 24 Aug 2016 18:38:15 -0700 Subject: Bump versioning. --- app/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/manifest.json b/app/manifest.json index 2ee8338a6..e5e08c4b6 100644 --- a/app/manifest.json +++ b/app/manifest.json @@ -1,7 +1,7 @@ { "name": "MetaMask", "short_name": "Metamask", - "version": "2.9.1", + "version": "2.9.2", "manifest_version": 2, "description": "Ethereum Browser Extension", "commands": { -- cgit v1.2.3 From 483a7fee0a815812ef43601f64083ed26825d0a4 Mon Sep 17 00:00:00 2001 From: Frankie Date: Tue, 23 Aug 2016 17:17:08 -0700 Subject: Add a back button on lock screen to go back to init menu --- app/scripts/lib/idStore.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'app') diff --git a/app/scripts/lib/idStore.js b/app/scripts/lib/idStore.js index 7ac71e409..0f36a520b 100644 --- a/app/scripts/lib/idStore.js +++ b/app/scripts/lib/idStore.js @@ -45,7 +45,11 @@ function IdentityStore (opts = {}) { IdentityStore.prototype.createNewVault = function (password, entropy, cb) { delete this._keyStore + var serializedKeystore = this.configManager.getWallet() + if (serializedKeystore) { + this.configManager.setData({}) + } this._createIdmgmt(password, null, entropy, (err) => { if (err) return cb(err) @@ -437,6 +441,7 @@ IdentityStore.prototype.tryPassword = function (password, cb) { IdentityStore.prototype._createIdmgmt = function (password, seed, entropy, cb) { const configManager = this.configManager + var keyStore = null LightwalletKeyStore.deriveKeyFromPassword(password, (err, derivedKey) => { if (err) return cb(err) -- cgit v1.2.3 From bb8241f711e3eaca55e92d461e89f1f02ff190cc Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Mon, 29 Aug 2016 11:14:18 -0700 Subject: Version 2.10.0 --- app/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/manifest.json b/app/manifest.json index e5e08c4b6..32b7d189e 100644 --- a/app/manifest.json +++ b/app/manifest.json @@ -1,7 +1,7 @@ { "name": "MetaMask", "short_name": "Metamask", - "version": "2.9.2", + "version": "2.10.0", "manifest_version": 2, "description": "Ethereum Browser Extension", "commands": { -- cgit v1.2.3