aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorKevin Serrano <kevgagser@gmail.com>2017-10-03 06:23:27 +0800
committerGitHub <noreply@github.com>2017-10-03 06:23:27 +0800
commit4b0e6a0a778efa24e6bbca1e9b60171606d46d2f (patch)
treeb5d338f9a9458a4cc3ff50abc0790823aac4b901 /ui
parente998d528f0af71d1163bc89fe9e81195bb4f5dc3 (diff)
parentb7c195160238119291ce62b01db1c8f7e4f94568 (diff)
downloadtangerine-wallet-browser-4b0e6a0a778efa24e6bbca1e9b60171606d46d2f.tar.gz
tangerine-wallet-browser-4b0e6a0a778efa24e6bbca1e9b60171606d46d2f.tar.zst
tangerine-wallet-browser-4b0e6a0a778efa24e6bbca1e9b60171606d46d2f.zip
Merge branch 'master' into RemoveSlackLink
Diffstat (limited to 'ui')
-rw-r--r--ui/app/actions.js33
-rw-r--r--ui/app/app.js2
-rw-r--r--ui/app/components/fiat-value.js3
-rw-r--r--ui/app/config.js8
-rw-r--r--ui/app/conversion.json207
-rw-r--r--ui/app/infura-conversion.json653
6 files changed, 669 insertions, 237 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js
index e793e6a21..3ea092e57 100644
--- a/ui/app/actions.js
+++ b/ui/app/actions.js
@@ -119,14 +119,11 @@ var actions = {
SET_RPC_TARGET: 'SET_RPC_TARGET',
SET_DEFAULT_RPC_TARGET: 'SET_DEFAULT_RPC_TARGET',
SET_PROVIDER_TYPE: 'SET_PROVIDER_TYPE',
- USE_ETHERSCAN_PROVIDER: 'USE_ETHERSCAN_PROVIDER',
- useEtherscanProvider: useEtherscanProvider,
showConfigPage,
SHOW_ADD_TOKEN_PAGE: 'SHOW_ADD_TOKEN_PAGE',
showAddTokenPage,
addToken,
setRpcTarget: setRpcTarget,
- setDefaultRpcTarget: setDefaultRpcTarget,
setProviderType: setProviderType,
// loading overlay
SHOW_LOADING: 'SHOW_LOADING_INDICATION',
@@ -706,16 +703,19 @@ function markAccountsFound () {
// config
//
-// default rpc target refers to localhost:8545 in this instance.
-function setDefaultRpcTarget () {
- log.debug(`background.setDefaultRpcTarget`)
+function setProviderType (type) {
return (dispatch) => {
- background.setDefaultRpc((err, result) => {
+ log.debug(`background.setProviderType`)
+ background.setProviderType(type, (err, result) => {
if (err) {
log.error(err)
- return dispatch(self.displayWarning('Had a problem changing networks.'))
+ return dispatch(self.displayWarning('Had a problem changing networks!'))
}
})
+ return {
+ type: actions.SET_PROVIDER_TYPE,
+ value: type,
+ }
}
}
@@ -744,23 +744,6 @@ function addToAddressBook (recipient, nickname) {
}
}
-function setProviderType (type) {
- log.debug(`background.setProviderType`)
- background.setProviderType(type)
- return {
- type: actions.SET_PROVIDER_TYPE,
- value: type,
- }
-}
-
-function useEtherscanProvider () {
- log.debug(`background.useEtherscanProvider`)
- background.useEtherscanProvider()
- return {
- type: actions.USE_ETHERSCAN_PROVIDER,
- }
-}
-
function showLoadingIndication (message) {
return {
type: actions.SHOW_LOADING,
diff --git a/ui/app/app.js b/ui/app/app.js
index ee800ea90..50121b055 100644
--- a/ui/app/app.js
+++ b/ui/app/app.js
@@ -319,7 +319,7 @@ App.prototype.renderNetworkDropdown = function () {
{
key: 'default',
closeMenu: () => this.setState({ isNetworkMenuOpen: !isOpen }),
- onClick: () => props.dispatch(actions.setDefaultRpcTarget()),
+ onClick: () => props.dispatch(actions.setProviderType('localhost')),
style: {
fontSize: '18px',
},
diff --git a/ui/app/components/fiat-value.js b/ui/app/components/fiat-value.js
index 8a64a1cfc..d69f41d11 100644
--- a/ui/app/components/fiat-value.js
+++ b/ui/app/components/fiat-value.js
@@ -13,6 +13,7 @@ function FiatValue () {
FiatValue.prototype.render = function () {
const props = this.props
const { conversionRate, currentCurrency } = props
+ const renderedCurrency = currentCurrency || ''
const value = formatBalance(props.value, 6)
@@ -28,7 +29,7 @@ FiatValue.prototype.render = function () {
fiatTooltipNumber = 'Unknown'
}
- return fiatDisplay(fiatDisplayNumber, currentCurrency)
+ return fiatDisplay(fiatDisplayNumber, renderedCurrency.toUpperCase())
}
function fiatDisplay (fiatDisplayNumber, fiatSuffix) {
diff --git a/ui/app/config.js b/ui/app/config.js
index d64088ccb..0fe232c07 100644
--- a/ui/app/config.js
+++ b/ui/app/config.js
@@ -3,7 +3,9 @@ const Component = require('react').Component
const h = require('react-hyperscript')
const connect = require('react-redux').connect
const actions = require('./actions')
-const currencies = require('./conversion.json').rows
+const infuraCurrencies = require('./infura-conversion.json').objects.sort((a, b) => {
+ return a.quote.name.toLocaleLowerCase().localeCompare(b.quote.name.toLocaleLowerCase())
+ })
const validUrl = require('valid-url')
const exportAsFile = require('./util').exportAsFile
@@ -167,8 +169,8 @@ function currentConversionInformation (metamaskState, state) {
state.dispatch(actions.setCurrentCurrency(newCurrency))
},
defaultValue: currentCurrency,
- }, currencies.map((currency) => {
- return h('option', {key: currency.code, value: currency.code}, `${currency.code} - ${currency.name}`)
+ }, infuraCurrencies.map((currency) => {
+ return h('option', {key: currency.quote.code, value: currency.quote.code}, `${currency.quote.code.toUpperCase()} - ${currency.quote.name}`)
})
),
])
diff --git a/ui/app/conversion.json b/ui/app/conversion.json
deleted file mode 100644
index 155ffc4fc..000000000
--- a/ui/app/conversion.json
+++ /dev/null
@@ -1,207 +0,0 @@
-{
- "rows": [
- {
- "code": "REP",
- "name": "Augur",
- "statuses": [
- "primary"
- ]
- },
- {
- "code": "BCN",
- "name": "Bytecoin",
- "statuses": [
- "primary"
- ]
- },
- {
- "code": "BTC",
- "name": "Bitcoin",
- "statuses": [
- "primary",
- "secondary"
- ]
- },
- {
- "code": "BTS",
- "name": "BitShares",
- "statuses": [
- "primary",
- "secondary"
- ]
- },
- {
- "code": "BLK",
- "name": "Blackcoin",
- "statuses": [
- "primary"
- ]
- },
- {
- "code": "GBP",
- "name": "British Pound Sterling",
- "statuses": [
- "secondary"
- ]
- },
- {
- "code": "CAD",
- "name": "Canadian Dollar",
- "statuses": [
- "secondary"
- ]
- },
- {
- "code": "CNY",
- "name": "Chinese Yuan",
- "statuses": [
- "secondary"
- ]
- },
- {
- "code": "DSH",
- "name": "Dashcoin",
- "statuses": [
- "primary"
- ]
- },
- {
- "code": "DOGE",
- "name": "Dogecoin",
- "statuses": [
- "primary",
- "secondary"
- ]
- },
- {
- "code": "ETC",
- "name": "Ethereum Classic",
- "statuses": [
- "primary"
- ]
- },
- {
- "code": "EUR",
- "name": "Euro",
- "statuses": [
- "primary",
- "secondary"
- ]
- },
- {
- "code": "GNO",
- "name": "GNO",
- "statuses": [
- "primary"
- ]
- },
- {
- "code": "GNT",
- "name": "GNT",
- "statuses": [
- "primary"
- ]
- },
- {
- "code": "JPY",
- "name": "Japanese Yen",
- "statuses": [
- "secondary"
- ]
- },
- {
- "code": "LTC",
- "name": "Litecoin",
- "statuses": [
- "primary",
- "secondary"
- ]
- },
- {
- "code": "MAID",
- "name": "MaidSafeCoin",
- "statuses": [
- "primary"
- ]
- },
- {
- "code": "XEM",
- "name": "NEM",
- "statuses": [
- "primary"
- ]
- },
- {
- "code": "XLM",
- "name": "Stellar",
- "statuses": [
- "primary"
- ]
- },
- {
- "code": "XMR",
- "name": "Monero",
- "statuses": [
- "primary",
- "secondary"
- ]
- },
- {
- "code": "XRP",
- "name": "Ripple",
- "statuses": [
- "primary"
- ]
- },
- {
- "code": "RUR",
- "name": "Ruble",
- "statuses": [
- "secondary"
- ]
- },
- {
- "code": "STEEM",
- "name": "Steem",
- "statuses": [
- "primary"
- ]
- },
- {
- "code": "STRAT",
- "name": "STRAT",
- "statuses": [
- "primary"
- ]
- },
- {
- "code": "UAH",
- "name": "Ukrainian Hryvnia",
- "statuses": [
- "secondary"
- ]
- },
- {
- "code": "USD",
- "name": "US Dollar",
- "statuses": [
- "primary",
- "secondary"
- ]
- },
- {
- "code": "WAVES",
- "name": "WAVES",
- "statuses": [
- "primary"
- ]
- },
- {
- "code": "ZEC",
- "name": "Zcash",
- "statuses": [
- "primary"
- ]
- }
- ]
-}
diff --git a/ui/app/infura-conversion.json b/ui/app/infura-conversion.json
new file mode 100644
index 000000000..9a96fe069
--- /dev/null
+++ b/ui/app/infura-conversion.json
@@ -0,0 +1,653 @@
+{
+ "objects": [
+ {
+ "symbol": "ethaud",
+ "base": {
+ "code": "eth",
+ "name": "Ethereum"
+ },
+ "quote": {
+ "code": "aud",
+ "name": "Australian Dollar"
+ }
+ },
+ {
+ "symbol": "ethhkd",
+ "base": {
+ "code": "eth",
+ "name": "Ethereum"
+ },
+ "quote": {
+ "code": "hkd",
+ "name": "Hong Kong Dollar"
+ }
+ },
+ {
+ "symbol": "ethsgd",
+ "base": {
+ "code": "eth",
+ "name": "Ethereum"
+ },
+ "quote": {
+ "code": "sgd",
+ "name": "Singapore Dollar"
+ }
+ },
+ {
+ "symbol": "ethidr",
+ "base": {
+ "code": "eth",
+ "name": "Ethereum"
+ },
+ "quote": {
+ "code": "idr",
+ "name": "Indonesian Rupiah"
+ }
+ },
+ {
+ "symbol": "ethphp",
+ "base": {
+ "code": "eth",
+ "name": "Ethereum"
+ },
+ "quote": {
+ "code": "php",
+ "name": "Philippine Peso"
+ }
+ },
+ {
+ "symbol": "eth1st",
+ "base": {
+ "code": "eth",
+ "name": "Ethereum"
+ },
+ "quote": {
+ "code": "1st",
+ "name": "FirstBlood"
+ }
+ },
+ {
+ "symbol": "ethadt",
+ "base": {
+ "code": "eth",
+ "name": "Ethereum"
+ },
+ "quote": {
+ "code": "adt",
+ "name": "adToken"
+ }
+ },
+ {
+ "symbol": "ethadx",
+ "base": {
+ "code": "eth",
+ "name": "Ethereum"
+ },
+ "quote": {
+ "code": "adx",
+ "name": "AdEx"
+ }
+ },
+ {
+ "symbol": "ethant",
+ "base": {
+ "code": "eth",
+ "name": "Ethereum"
+ },
+ "quote": {
+ "code": "ant",
+ "name": "Aragon"
+ }
+ },
+ {
+ "symbol": "ethbat",
+ "base": {
+ "code": "eth",
+ "name": "Ethereum"
+ },
+ "quote": {
+ "code": "bat",
+ "name": "Basic Attention Token"
+ }
+ },
+ {
+ "symbol": "ethbnt",
+ "base": {
+ "code": "eth",
+ "name": "Ethereum"
+ },
+ "quote": {
+ "code": "bnt",
+ "name": "Bancor"
+ }
+ },
+ {
+ "symbol": "ethbtc",
+ "base": {
+ "code": "eth",
+ "name": "Ethereum"
+ },
+ "quote": {
+ "code": "btc",
+ "name": "Bitcoin"
+ }
+ },
+ {
+ "symbol": "ethcad",
+ "base": {
+ "code": "eth",
+ "name": "Ethereum"
+ },
+ "quote": {
+ "code": "cad",
+ "name": "Canadian Dollar"
+ }
+ },
+ {
+ "symbol": "ethcfi",
+ "base": {
+ "code": "eth",
+ "name": "Ethereum"
+ },
+ "quote": {
+ "code": "cfi",
+ "name": "Cofound.it"
+ }
+ },
+ {
+ "symbol": "ethcrb",
+ "base": {
+ "code": "eth",
+ "name": "Ethereum"
+ },
+ "quote": {
+ "code": "crb",
+ "name": "CreditBit"
+ }
+ },
+ {
+ "symbol": "ethcvc",
+ "base": {
+ "code": "eth",
+ "name": "Ethereum"
+ },
+ "quote": {
+ "code": "cvc",
+ "name": "Civic"
+ }
+ },
+ {
+ "symbol": "ethdash",
+ "base": {
+ "code": "eth",
+ "name": "Ethereum"
+ },
+ "quote": {
+ "code": "dash",
+ "name": "Dash"
+ }
+ },
+ {
+ "symbol": "ethdgd",
+ "base": {
+ "code": "eth",
+ "name": "Ethereum"
+ },
+ "quote": {
+ "code": "dgd",
+ "name": "DigixDAO"
+ }
+ },
+ {
+ "symbol": "ethetc",
+ "base": {
+ "code": "eth",
+ "name": "Ethereum"
+ },
+ "quote": {
+ "code": "etc",
+ "name": "Ethereum Classic"
+ }
+ },
+ {
+ "symbol": "etheur",
+ "base": {
+ "code": "eth",
+ "name": "Ethereum"
+ },
+ "quote": {
+ "code": "eur",
+ "name": "Euro"
+ }
+ },
+ {
+ "symbol": "ethfun",
+ "base": {
+ "code": "eth",
+ "name": "Ethereum"
+ },
+ "quote": {
+ "code": "fun",
+ "name": "FunFair"
+ }
+ },
+ {
+ "symbol": "ethgbp",
+ "base": {
+ "code": "eth",
+ "name": "Ethereum"
+ },
+ "quote": {
+ "code": "gbp",
+ "name": "Pound Sterling"
+ }
+ },
+ {
+ "symbol": "ethgno",
+ "base": {
+ "code": "eth",
+ "name": "Ethereum"
+ },
+ "quote": {
+ "code": "gno",
+ "name": "Gnosis"
+ }
+ },
+ {
+ "symbol": "ethgnt",
+ "base": {
+ "code": "eth",
+ "name": "Ethereum"
+ },
+ "quote": {
+ "code": "gnt",
+ "name": "Golem"
+ }
+ },
+ {
+ "symbol": "ethgup",
+ "base": {
+ "code": "eth",
+ "name": "Ethereum"
+ },
+ "quote": {
+ "code": "gup",
+ "name": "Matchpool"
+ }
+ },
+ {
+ "symbol": "ethhmq",
+ "base": {
+ "code": "eth",
+ "name": "Ethereum"
+ },
+ "quote": {
+ "code": "hmq",
+ "name": "Humaniq"
+ }
+ },
+ {
+ "symbol": "ethjpy",
+ "base": {
+ "code": "eth",
+ "name": "Ethereum"
+ },
+ "quote": {
+ "code": "jpy",
+ "name": "Japanese Yen"
+ }
+ },
+ {
+ "symbol": "ethlgd",
+ "base": {
+ "code": "eth",
+ "name": "Ethereum"
+ },
+ "quote": {
+ "code": "lgd",
+ "name": "Legends Room"
+ }
+ },
+ {
+ "symbol": "ethlsk",
+ "base": {
+ "code": "eth",
+ "name": "Ethereum"
+ },
+ "quote": {
+ "code": "lsk",
+ "name": "Lisk"
+ }
+ },
+ {
+ "symbol": "ethltc",
+ "base": {
+ "code": "eth",
+ "name": "Ethereum"
+ },
+ "quote": {
+ "code": "ltc",
+ "name": "Litecoin"
+ }
+ },
+ {
+ "symbol": "ethlun",
+ "base": {
+ "code": "eth",
+ "name": "Ethereum"
+ },
+ "quote": {
+ "code": "lun",
+ "name": "Lunyr"
+ }
+ },
+ {
+ "symbol": "ethmco",
+ "base": {
+ "code": "eth",
+ "name": "Ethereum"
+ },
+ "quote": {
+ "code": "mco",
+ "name": "Monaco"
+ }
+ },
+ {
+ "symbol": "ethmtl",
+ "base": {
+ "code": "eth",
+ "name": "Ethereum"
+ },
+ "quote": {
+ "code": "mtl",
+ "name": "Metal"
+ }
+ },
+ {
+ "symbol": "ethmyst",
+ "base": {
+ "code": "eth",
+ "name": "Ethereum"
+ },
+ "quote": {
+ "code": "myst",
+ "name": "Mysterium"
+ }
+ },
+ {
+ "symbol": "ethnmr",
+ "base": {
+ "code": "eth",
+ "name": "Ethereum"
+ },
+ "quote": {
+ "code": "nmr",
+ "name": "Numeraire"
+ }
+ },
+ {
+ "symbol": "ethomg",
+ "base": {
+ "code": "eth",
+ "name": "Ethereum"
+ },
+ "quote": {
+ "code": "omg",
+ "name": "OmiseGO"
+ }
+ },
+ {
+ "symbol": "ethpay",
+ "base": {
+ "code": "eth",
+ "name": "Ethereum"
+ },
+ "quote": {
+ "code": "pay",
+ "name": "TenX"
+ }
+ },
+ {
+ "symbol": "ethptoy",
+ "base": {
+ "code": "eth",
+ "name": "Ethereum"
+ },
+ "quote": {
+ "code": "ptoy",
+ "name": "Patientory"
+ }
+ },
+ {
+ "symbol": "ethqrl",
+ "base": {
+ "code": "eth",
+ "name": "Ethereum"
+ },
+ "quote": {
+ "code": "qrl",
+ "name": "Quantum-Resistant Ledger"
+ }
+ },
+ {
+ "symbol": "ethqtum",
+ "base": {
+ "code": "eth",
+ "name": "Ethereum"
+ },
+ "quote": {
+ "code": "qtum",
+ "name": "Qtum"
+ }
+ },
+ {
+ "symbol": "ethrep",
+ "base": {
+ "code": "eth",
+ "name": "Ethereum"
+ },
+ "quote": {
+ "code": "rep",
+ "name": "Augur"
+ }
+ },
+ {
+ "symbol": "ethrlc",
+ "base": {
+ "code": "eth",
+ "name": "Ethereum"
+ },
+ "quote": {
+ "code": "rlc",
+ "name": "iEx.ec"
+ }
+ },
+ {
+ "symbol": "ethrub",
+ "base": {
+ "code": "eth",
+ "name": "Ethereum"
+ },
+ "quote": {
+ "code": "rub",
+ "name": "Russian Ruble"
+ }
+ },
+ {
+ "symbol": "ethsc",
+ "base": {
+ "code": "eth",
+ "name": "Ethereum"
+ },
+ "quote": {
+ "code": "sc",
+ "name": "Siacoin"
+ }
+ },
+ {
+ "symbol": "ethsngls",
+ "base": {
+ "code": "eth",
+ "name": "Ethereum"
+ },
+ "quote": {
+ "code": "sngls",
+ "name": "SingularDTV"
+ }
+ },
+ {
+ "symbol": "ethsnt",
+ "base": {
+ "code": "eth",
+ "name": "Ethereum"
+ },
+ "quote": {
+ "code": "snt",
+ "name": "Status"
+ }
+ },
+ {
+ "symbol": "ethsteem",
+ "base": {
+ "code": "eth",
+ "name": "Ethereum"
+ },
+ "quote": {
+ "code": "steem",
+ "name": "Steem"
+ }
+ },
+ {
+ "symbol": "ethstorj",
+ "base": {
+ "code": "eth",
+ "name": "Ethereum"
+ },
+ "quote": {
+ "code": "storj",
+ "name": "Storj"
+ }
+ },
+ {
+ "symbol": "ethtime",
+ "base": {
+ "code": "eth",
+ "name": "Ethereum"
+ },
+ "quote": {
+ "code": "time",
+ "name": "ChronoBank"
+ }
+ },
+ {
+ "symbol": "ethtkn",
+ "base": {
+ "code": "eth",
+ "name": "Ethereum"
+ },
+ "quote": {
+ "code": "tkn",
+ "name": "TokenCard"
+ }
+ },
+ {
+ "symbol": "ethtrst",
+ "base": {
+ "code": "eth",
+ "name": "Ethereum"
+ },
+ "quote": {
+ "code": "trst",
+ "name": "WeTrust"
+ }
+ },
+ {
+ "symbol": "ethuah",
+ "base": {
+ "code": "eth",
+ "name": "Ethereum"
+ },
+ "quote": {
+ "code": "uah",
+ "name": "Ukrainian Hryvnia"
+ }
+ },
+ {
+ "symbol": "ethusd",
+ "base": {
+ "code": "eth",
+ "name": "Ethereum"
+ },
+ "quote": {
+ "code": "usd",
+ "name": "United States Dollar"
+ }
+ },
+ {
+ "symbol": "ethwings",
+ "base": {
+ "code": "eth",
+ "name": "Ethereum"
+ },
+ "quote": {
+ "code": "wings",
+ "name": "Wings"
+ }
+ },
+ {
+ "symbol": "ethxem",
+ "base": {
+ "code": "eth",
+ "name": "Ethereum"
+ },
+ "quote": {
+ "code": "xem",
+ "name": "NEM"
+ }
+ },
+ {
+ "symbol": "ethxlm",
+ "base": {
+ "code": "eth",
+ "name": "Ethereum"
+ },
+ "quote": {
+ "code": "xlm",
+ "name": "Stellar Lumen"
+ }
+ },
+ {
+ "symbol": "ethxmr",
+ "base": {
+ "code": "eth",
+ "name": "Ethereum"
+ },
+ "quote": {
+ "code": "xmr",
+ "name": "Monero"
+ }
+ },
+ {
+ "symbol": "ethxrp",
+ "base": {
+ "code": "eth",
+ "name": "Ethereum"
+ },
+ "quote": {
+ "code": "xrp",
+ "name": "Ripple"
+ }
+ },
+ {
+ "symbol": "ethzec",
+ "base": {
+ "code": "eth",
+ "name": "Ethereum"
+ },
+ "quote": {
+ "code": "zec",
+ "name": "Zcash"
+ }
+ }
+ ]
+}