aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/_locales/es/messages.json10
-rw-r--r--app/_locales/es_419/messages.json10
-rw-r--r--app/_locales/zh_CN/messages.json10
-rw-r--r--app/images/icon-512.pngbin0 -> 42078 bytes
-rw-r--r--app/manifest.json12
-rw-r--r--app/scripts/inpage.js2
-rw-r--r--app/scripts/lib/config-manager.js10
-rw-r--r--app/scripts/lib/inpage-provider.js30
-rw-r--r--app/scripts/metamask-controller.js1
9 files changed, 79 insertions, 6 deletions
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"
+ }
+}
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"
+ }
+}
diff --git a/app/images/icon-512.png b/app/images/icon-512.png
new file mode 100644
index 000000000..9c0d1384d
--- /dev/null
+++ b/app/images/icon-512.png
Binary files differ
diff --git a/app/manifest.json b/app/manifest.json
index 09bc9eb37..e5e08c4b6 100644
--- a/app/manifest.json
+++ b/app/manifest.json
@@ -1,9 +1,19 @@
{
"name": "MetaMask",
"short_name": "Metamask",
- "version": "2.9.0",
+ "version": "2.9.2",
"manifest_version": 2,
"description": "Ethereum Browser Extension",
+ "commands": {
+ "_execute_browser_action": {
+ "suggested_key": {
+ "windows": "Alt+Shift+M",
+ "mac": "Alt+Shift+M",
+ "chromeos": "Search+M",
+ "linux": "Alt+Shift+M"
+ }
+ }
+ },
"icons": {
"16": "images/icon-16.png",
"128": "images/icon-128.png"
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.')
}
diff --git a/app/scripts/lib/config-manager.js b/app/scripts/lib/config-manager.js
index 6f5cb3a4a..715efb42e 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)
}
@@ -294,9 +300,10 @@ ConfigManager.prototype.updateConversionRate = function () {
this.setConversionPrice(0)
this.setConversionDate('N/A')
})
+
}
-ConfigManager.prototype.setConversionPrice = function(price) {
+ConfigManager.prototype.setConversionPrice = function (price) {
var data = this.getData()
data.conversionRate = Number(price)
this.setData(data)
@@ -366,4 +373,3 @@ ConfigManager.prototype.createShapeShiftTx = function (depositAddress, depositTy
}
this.setData(data)
}
-
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
diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js
index 218f1f72a..d53094e43 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) {
+ this.idStore.addUnconfirmedMessage(msgParams, cb)
this.opts.unlockAccountMessage()
} else {
this.addUnconfirmedMessage(msgParams, cb)