aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2017-05-27 00:58:33 +0800
committerDan Finlay <dan@danfinlay.com>2017-05-27 00:58:33 +0800
commitf06ad954b900aa94a36fbb3e4765d0a9222e0920 (patch)
tree6a3b2ca46db6164e11a247e8f6e71ef2335dca14 /ui
parent7268fcb694b1cf43e1983b2f693ed731d3c2ec9b (diff)
downloadtangerine-wallet-browser-f06ad954b900aa94a36fbb3e4765d0a9222e0920.tar
tangerine-wallet-browser-f06ad954b900aa94a36fbb3e4765d0a9222e0920.tar.gz
tangerine-wallet-browser-f06ad954b900aa94a36fbb3e4765d0a9222e0920.tar.bz2
tangerine-wallet-browser-f06ad954b900aa94a36fbb3e4765d0a9222e0920.tar.lz
tangerine-wallet-browser-f06ad954b900aa94a36fbb3e4765d0a9222e0920.tar.xz
tangerine-wallet-browser-f06ad954b900aa94a36fbb3e4765d0a9222e0920.tar.zst
tangerine-wallet-browser-f06ad954b900aa94a36fbb3e4765d0a9222e0920.zip
Move to eth-contract-metadata
Diffstat (limited to 'ui')
-rw-r--r--ui/lib/icon-factory.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/ui/lib/icon-factory.js b/ui/lib/icon-factory.js
index 4aed9109b..c16507527 100644
--- a/ui/lib/icon-factory.js
+++ b/ui/lib/icon-factory.js
@@ -1,7 +1,7 @@
var iconFactory
const isValidAddress = require('ethereumjs-util').isValidAddress
const toChecksumAddress = require('ethereumjs-util').toChecksumAddress
-const iconMap = require('ethereum-contract-icons')
+const contractMap = require('eth-contract-metadata')
module.exports = function (jazzicon) {
if (!iconFactory) {
@@ -43,11 +43,12 @@ IconFactory.prototype.generateNewIdenticon = function (address, diameter) {
// util
function iconExistsFor (address) {
- return (address in iconMap) && isValidAddress(address)
+ return (address in contractMap) && isValidAddress(address) && ('logo' in contractMap[address])
}
function imageElFor (address) {
- const fileName = iconMap[address]
+ const contract = contractMap[address]
+ const fileName = contract.logo
const path = `images/contract/${fileName}`
const img = document.createElement('img')
img.src = path