mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Merge branch 'master' into i1165-predictive
This commit is contained in:
commit
a186e40d17
@ -636,7 +636,7 @@ module.exports = class MetamaskController extends EventEmitter {
|
|||||||
this.currencyController.updateConversionRate()
|
this.currencyController.updateConversionRate()
|
||||||
const data = {
|
const data = {
|
||||||
conversionRate: this.currencyController.getConversionRate(),
|
conversionRate: this.currencyController.getConversionRate(),
|
||||||
currentFiat: this.currencyController.getCurrentCurrency(),
|
currentCurrency: this.currencyController.getCurrentCurrency(),
|
||||||
conversionDate: this.currencyController.getConversionDate(),
|
conversionDate: this.currencyController.getConversionDate(),
|
||||||
}
|
}
|
||||||
cb(null, data)
|
cb(null, data)
|
||||||
|
@ -2,7 +2,7 @@ const version = 10
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
||||||
This migration breaks out the CurrencyController substate
|
This migration breaks out the ShapeShiftController substate
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ const version = 11
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
||||||
This migration breaks out the CurrencyController substate
|
This migration removes the discaimer state from our app, which was integrated into our notices.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"metamask": {
|
"metamask": {
|
||||||
"currentFiat": "USD",
|
"currentCurrency": "USD",
|
||||||
"conversionRate": 11.06608791,
|
"conversionRate": 11.06608791,
|
||||||
"conversionDate": 1470421024,
|
"conversionDate": 1470421024,
|
||||||
"isInitialized": true,
|
"isInitialized": true,
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"metamask": {
|
"metamask": {
|
||||||
"currentFiat": "USD",
|
"currentCurrency": "USD",
|
||||||
"conversionRate": 11.06608791,
|
"conversionRate": 11.06608791,
|
||||||
"conversionDate": 1470421024,
|
"conversionDate": 1470421024,
|
||||||
"isInitialized": true,
|
"isInitialized": true,
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"metamask": {
|
"metamask": {
|
||||||
"currentFiat": "USD",
|
"currentCurrency": "USD",
|
||||||
"conversionRate": 11.06608791,
|
"conversionRate": 11.06608791,
|
||||||
"conversionDate": 1470421024,
|
"conversionDate": 1470421024,
|
||||||
"isInitialized": true,
|
"isInitialized": true,
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"unconfTxs": {},
|
"unconfTxs": {},
|
||||||
"currentFiat": "USD",
|
"currentCurrency": "USD",
|
||||||
"conversionRate": 10.19458075,
|
"conversionRate": 10.19458075,
|
||||||
"conversionDate": 1484696373,
|
"conversionDate": 1484696373,
|
||||||
"noActiveNotices": true,
|
"noActiveNotices": true,
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"unconfTxs": {},
|
"unconfTxs": {},
|
||||||
"currentFiat": "USD",
|
"currentCurrency": "USD",
|
||||||
"conversionRate": 0,
|
"conversionRate": 0,
|
||||||
"conversionDate": "N/A",
|
"conversionDate": "N/A",
|
||||||
"noActiveNotices": true,
|
"noActiveNotices": true,
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"unconfTxs": {},
|
"unconfTxs": {},
|
||||||
"currentFiat": "USD",
|
"currentCurrency": "USD",
|
||||||
"conversionRate": 11.84461814,
|
"conversionRate": 11.84461814,
|
||||||
"conversionDate": 1476226414,
|
"conversionDate": 1476226414,
|
||||||
"accounts": {
|
"accounts": {
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
"simulationFails": true
|
"simulationFails": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"currentFiat": "USD",
|
"currentCurrency": "USD",
|
||||||
"conversionRate": 7.69158136,
|
"conversionRate": 7.69158136,
|
||||||
"conversionDate": 1482279663,
|
"conversionDate": 1482279663,
|
||||||
"noActiveNotices": true,
|
"noActiveNotices": true,
|
||||||
|
@ -48,7 +48,7 @@
|
|||||||
"gasPrice": "4a817c800"
|
"gasPrice": "4a817c800"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"currentFiat": "USD",
|
"currentCurrency": "USD",
|
||||||
"conversionRate": 12.7200827,
|
"conversionRate": 12.7200827,
|
||||||
"conversionDate": 1487363041,
|
"conversionDate": 1487363041,
|
||||||
"noActiveNotices": true,
|
"noActiveNotices": true,
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"metamask": {
|
"metamask": {
|
||||||
"currentFiat": "USD",
|
"currentCurrency": "USD",
|
||||||
"conversionRate": 11.06608791,
|
"conversionRate": 11.06608791,
|
||||||
"conversionDate": 1470421024,
|
"conversionDate": 1470421024,
|
||||||
"isInitialized": true,
|
"isInitialized": true,
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
"identities": {},
|
"identities": {},
|
||||||
"frequentRpcList": [],
|
"frequentRpcList": [],
|
||||||
"unapprovedTxs": {},
|
"unapprovedTxs": {},
|
||||||
"currentFiat": "USD",
|
"currentCurrency": "USD",
|
||||||
"conversionRate": 12.7527416,
|
"conversionRate": 12.7527416,
|
||||||
"conversionDate": 1487624341,
|
"conversionDate": 1487624341,
|
||||||
"noActiveNotices": false,
|
"noActiveNotices": false,
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"unconfTxs": {},
|
"unconfTxs": {},
|
||||||
"currentFiat": "USD",
|
"currentCurrency": "USD",
|
||||||
"conversionRate": 10.1219126,
|
"conversionRate": 10.1219126,
|
||||||
"conversionDate": 1484695442,
|
"conversionDate": 1484695442,
|
||||||
"noActiveNotices": true,
|
"noActiveNotices": true,
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"unconfTxs": {},
|
"unconfTxs": {},
|
||||||
"currentFiat": "USD",
|
"currentCurrency": "USD",
|
||||||
"conversionRate": 10.10788584,
|
"conversionRate": 10.10788584,
|
||||||
"conversionDate": 1484694362,
|
"conversionDate": 1484694362,
|
||||||
"noActiveNotices": true,
|
"noActiveNotices": true,
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
"rpcTarget": "https://rawtestrpc.metamask.io/",
|
"rpcTarget": "https://rawtestrpc.metamask.io/",
|
||||||
"identities": {},
|
"identities": {},
|
||||||
"unconfTxs": {},
|
"unconfTxs": {},
|
||||||
"currentFiat": "USD",
|
"currentCurrency": "USD",
|
||||||
"conversionRate": 11.4379398,
|
"conversionRate": 11.4379398,
|
||||||
"conversionDate": 1473358355,
|
"conversionDate": 1473358355,
|
||||||
"accounts": {},
|
"accounts": {},
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"metamask": {
|
"metamask": {
|
||||||
"currentFiat": "USD",
|
"currentCurrency": "USD",
|
||||||
"lostAccounts": [
|
"lostAccounts": [
|
||||||
"0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc",
|
"0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc",
|
||||||
"0xec1adf982415d2ef5ec55899b9bfb8bc0f29251b"
|
"0xec1adf982415d2ef5ec55899b9bfb8bc0f29251b"
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"unconfTxs": {},
|
"unconfTxs": {},
|
||||||
"currentFiat": "USD",
|
"currentCurrency": "USD",
|
||||||
"conversionRate": 10.92067835,
|
"conversionRate": 10.92067835,
|
||||||
"conversionDate": 1478282884,
|
"conversionDate": 1478282884,
|
||||||
"network": null,
|
"network": null,
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"unconfTxs": {},
|
"unconfTxs": {},
|
||||||
"currentFiat": "USD",
|
"currentCurrency": "USD",
|
||||||
"conversionRate": 8.3533002,
|
"conversionRate": 8.3533002,
|
||||||
"conversionDate": 1481671082,
|
"conversionDate": 1481671082,
|
||||||
"noActiveNotices": false,
|
"noActiveNotices": false,
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"unconfTxs": {},
|
"unconfTxs": {},
|
||||||
"currentFiat": "USD",
|
"currentCurrency": "USD",
|
||||||
"conversionRate": 11.02269525,
|
"conversionRate": 11.02269525,
|
||||||
"conversionDate": 1472076963,
|
"conversionDate": 1472076963,
|
||||||
"accounts": {
|
"accounts": {
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
"maxCost": "de234b52e4a0800"
|
"maxCost": "de234b52e4a0800"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"currentFiat": "USD",
|
"currentCurrency": "USD",
|
||||||
"conversionRate": 12.59854817,
|
"conversionRate": 12.59854817,
|
||||||
"conversionDate": 1487662141,
|
"conversionDate": 1487662141,
|
||||||
"noActiveNotices": true,
|
"noActiveNotices": true,
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"unapprovedTxs": {},
|
"unapprovedTxs": {},
|
||||||
"currentFiat": "USD",
|
"currentCurrency": "USD",
|
||||||
"conversionRate": 13.2126613,
|
"conversionRate": 13.2126613,
|
||||||
"conversionDate": 1487888522,
|
"conversionDate": 1487888522,
|
||||||
"noActiveNotices": true,
|
"noActiveNotices": true,
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"unconfTxs": {},
|
"unconfTxs": {},
|
||||||
"currentFiat": "USD",
|
"currentCurrency": "USD",
|
||||||
"conversionRate": 9.52855776,
|
"conversionRate": 9.52855776,
|
||||||
"conversionDate": 1479756513,
|
"conversionDate": 1479756513,
|
||||||
"accounts": {
|
"accounts": {
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
"rpcTarget": "https://rawtestrpc.metamask.io/",
|
"rpcTarget": "https://rawtestrpc.metamask.io/",
|
||||||
"identities": {},
|
"identities": {},
|
||||||
"unconfTxs": {},
|
"unconfTxs": {},
|
||||||
"currentFiat": "USD",
|
"currentCurrency": "USD",
|
||||||
"conversionRate": 0,
|
"conversionRate": 0,
|
||||||
"conversionDate": "N/A",
|
"conversionDate": "N/A",
|
||||||
"accounts": {},
|
"accounts": {},
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"unapprovedTxs": {},
|
"unapprovedTxs": {},
|
||||||
"currentFiat": "USD",
|
"currentCurrency": "USD",
|
||||||
"conversionRate": 16.88200327,
|
"conversionRate": 16.88200327,
|
||||||
"conversionDate": 1489013762,
|
"conversionDate": 1489013762,
|
||||||
"noActiveNotices": true,
|
"noActiveNotices": true,
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"unconfTxs": {},
|
"unconfTxs": {},
|
||||||
"currentFiat": "USD",
|
"currentCurrency": "USD",
|
||||||
"conversionRate": 11.21274318,
|
"conversionRate": 11.21274318,
|
||||||
"conversionDate": 1472159644,
|
"conversionDate": 1472159644,
|
||||||
"accounts": {
|
"accounts": {
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
"rpcTarget": "https://rawtestrpc.metamask.io/",
|
"rpcTarget": "https://rawtestrpc.metamask.io/",
|
||||||
"identities": {},
|
"identities": {},
|
||||||
"unconfTxs": {},
|
"unconfTxs": {},
|
||||||
"currentFiat": "USD",
|
"currentCurrency": "USD",
|
||||||
"conversionRate": 8.18703468,
|
"conversionRate": 8.18703468,
|
||||||
"conversionDate": 1481755832,
|
"conversionDate": 1481755832,
|
||||||
"network": "3",
|
"network": "3",
|
||||||
|
@ -71,7 +71,7 @@ var actions = {
|
|||||||
SHOW_CONF_TX_PAGE: 'SHOW_CONF_TX_PAGE',
|
SHOW_CONF_TX_PAGE: 'SHOW_CONF_TX_PAGE',
|
||||||
SHOW_CONF_MSG_PAGE: 'SHOW_CONF_MSG_PAGE',
|
SHOW_CONF_MSG_PAGE: 'SHOW_CONF_MSG_PAGE',
|
||||||
SET_CURRENT_FIAT: 'SET_CURRENT_FIAT',
|
SET_CURRENT_FIAT: 'SET_CURRENT_FIAT',
|
||||||
setCurrentFiat: setCurrentFiat,
|
setCurrentCurrency: setCurrentCurrency,
|
||||||
// account detail screen
|
// account detail screen
|
||||||
SHOW_SEND_PAGE: 'SHOW_SEND_PAGE',
|
SHOW_SEND_PAGE: 'SHOW_SEND_PAGE',
|
||||||
showSendPage: showSendPage,
|
showSendPage: showSendPage,
|
||||||
@ -330,10 +330,10 @@ function showInfoPage () {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function setCurrentFiat (currencyCode) {
|
function setCurrentCurrency (currencyCode) {
|
||||||
return (dispatch) => {
|
return (dispatch) => {
|
||||||
dispatch(this.showLoadingIndication())
|
dispatch(this.showLoadingIndication())
|
||||||
log.debug(`background.setCurrentFiat`)
|
log.debug(`background.setCurrentCurrency`)
|
||||||
background.setCurrentCurrency(currencyCode, (err, data) => {
|
background.setCurrentCurrency(currencyCode, (err, data) => {
|
||||||
dispatch(this.hideLoadingIndication())
|
dispatch(this.hideLoadingIndication())
|
||||||
if (err) {
|
if (err) {
|
||||||
@ -343,7 +343,7 @@ function setCurrentFiat (currencyCode) {
|
|||||||
dispatch({
|
dispatch({
|
||||||
type: this.SET_CURRENT_FIAT,
|
type: this.SET_CURRENT_FIAT,
|
||||||
value: {
|
value: {
|
||||||
currentFiat: data.currentFiat,
|
currentCurrency: data.currentCurrency,
|
||||||
conversionRate: data.conversionRate,
|
conversionRate: data.conversionRate,
|
||||||
conversionDate: data.conversionDate,
|
conversionDate: data.conversionDate,
|
||||||
},
|
},
|
||||||
|
@ -9,7 +9,7 @@ module.exports = connect(mapStateToProps)(FiatValue)
|
|||||||
function mapStateToProps (state) {
|
function mapStateToProps (state) {
|
||||||
return {
|
return {
|
||||||
conversionRate: state.metamask.conversionRate,
|
conversionRate: state.metamask.conversionRate,
|
||||||
currentFiat: state.metamask.currentFiat,
|
currentCurrency: state.metamask.currentCurrency,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -34,7 +34,7 @@ FiatValue.prototype.render = function () {
|
|||||||
fiatTooltipNumber = 'Unknown'
|
fiatTooltipNumber = 'Unknown'
|
||||||
}
|
}
|
||||||
|
|
||||||
var fiatSuffix = props.currentFiat
|
var fiatSuffix = props.currentCurrency
|
||||||
|
|
||||||
return fiatDisplay(fiatDisplayNumber, fiatSuffix)
|
return fiatDisplay(fiatDisplayNumber, fiatSuffix)
|
||||||
}
|
}
|
||||||
|
@ -125,19 +125,19 @@ function rpcValidation (newRpc, state) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function currentConversionInformation (metamaskState, state) {
|
function currentConversionInformation (metamaskState, state) {
|
||||||
var currentFiat = metamaskState.currentFiat
|
var currentCurrency = metamaskState.currentCurrency
|
||||||
var conversionDate = metamaskState.conversionDate
|
var conversionDate = metamaskState.conversionDate
|
||||||
return h('div', [
|
return h('div', [
|
||||||
h('span', {style: { fontWeight: 'bold', paddingRight: '10px'}}, 'Current Conversion'),
|
h('span', {style: { fontWeight: 'bold', paddingRight: '10px'}}, 'Current Conversion'),
|
||||||
h('span', {style: { fontWeight: 'bold', paddingRight: '10px', fontSize: '13px'}}, `Updated ${Date(conversionDate)}`),
|
h('span', {style: { fontWeight: 'bold', paddingRight: '10px', fontSize: '13px'}}, `Updated ${Date(conversionDate)}`),
|
||||||
h('select#currentFiat', {
|
h('select#currentCurrency', {
|
||||||
onChange (event) {
|
onChange (event) {
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
var element = document.getElementById('currentFiat')
|
var element = document.getElementById('currentCurrency')
|
||||||
var newFiat = element.value
|
var newCurrency = element.value
|
||||||
state.dispatch(actions.setCurrentFiat(newFiat))
|
state.dispatch(actions.setCurrentCurrency(newCurrency))
|
||||||
},
|
},
|
||||||
defaultValue: currentFiat,
|
defaultValue: currentCurrency,
|
||||||
}, currencies.map((currency) => {
|
}, currencies.map((currency) => {
|
||||||
return h('option', {key: currency.code, value: currency.code}, `${currency.code} - ${currency.name}`)
|
return h('option', {key: currency.code, value: currency.code}, `${currency.code} - ${currency.name}`)
|
||||||
})
|
})
|
||||||
|
@ -13,9 +13,6 @@ function reduceMetamask (state, action) {
|
|||||||
rpcTarget: 'https://rawtestrpc.metamask.io/',
|
rpcTarget: 'https://rawtestrpc.metamask.io/',
|
||||||
identities: {},
|
identities: {},
|
||||||
unapprovedTxs: {},
|
unapprovedTxs: {},
|
||||||
currentFiat: 'USD',
|
|
||||||
conversionRate: 0,
|
|
||||||
conversionDate: 'N/A',
|
|
||||||
noActiveNotices: true,
|
noActiveNotices: true,
|
||||||
lastUnreadNotice: undefined,
|
lastUnreadNotice: undefined,
|
||||||
frequentRpcList: [],
|
frequentRpcList: [],
|
||||||
@ -127,7 +124,7 @@ function reduceMetamask (state, action) {
|
|||||||
|
|
||||||
case actions.SET_CURRENT_FIAT:
|
case actions.SET_CURRENT_FIAT:
|
||||||
return extend(metamaskState, {
|
return extend(metamaskState, {
|
||||||
currentFiat: action.value.currentFiat,
|
currentCurrency: action.value.currentCurrency,
|
||||||
conversionRate: action.value.conversionRate,
|
conversionRate: action.value.conversionRate,
|
||||||
conversionDate: action.value.conversionDate,
|
conversionDate: action.value.conversionDate,
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user