mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Merge branch 'master' into i390-TransactionLimit
This commit is contained in:
commit
5c9ca21ba3
10
app/_locales/es/messages.json
Normal file
10
app/_locales/es/messages.json
Normal file
@ -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"
|
||||||
|
}
|
||||||
|
}
|
10
app/_locales/es_419/messages.json
Normal file
10
app/_locales/es_419/messages.json
Normal file
@ -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"
|
||||||
|
}
|
||||||
|
}
|
10
app/_locales/zh_CN/messages.json
Normal file
10
app/_locales/zh_CN/messages.json
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"appName": {
|
||||||
|
"message": "MetaMask",
|
||||||
|
"description": "The name of the application"
|
||||||
|
},
|
||||||
|
"appDescription": {
|
||||||
|
"message": "以太坊身份管理",
|
||||||
|
"description": "The description of the application"
|
||||||
|
}
|
||||||
|
}
|
@ -33,8 +33,16 @@ function MetamaskInpageProvider (connectionStream) {
|
|||||||
})
|
})
|
||||||
asyncProvider.on('error', console.error.bind(console))
|
asyncProvider.on('error', console.error.bind(console))
|
||||||
self.asyncProvider = asyncProvider
|
self.asyncProvider = asyncProvider
|
||||||
// overwrite own sendAsync method
|
// handle sendAsync requests via asyncProvider
|
||||||
self.sendAsync = asyncProvider.sendAsync.bind(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) {
|
MetamaskInpageProvider.prototype.send = function (payload) {
|
||||||
@ -92,3 +100,21 @@ function remoteStoreWithLocalStorageCache (storageKey) {
|
|||||||
|
|
||||||
return store
|
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)
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user