diff options
author | Dan Finlay <dan@danfinlay.com> | 2017-05-27 00:58:33 +0800 |
---|---|---|
committer | Dan Finlay <dan@danfinlay.com> | 2017-05-27 00:58:33 +0800 |
commit | f06ad954b900aa94a36fbb3e4765d0a9222e0920 (patch) | |
tree | 6a3b2ca46db6164e11a247e8f6e71ef2335dca14 | |
parent | 7268fcb694b1cf43e1983b2f693ed731d3c2ec9b (diff) | |
download | tangerine-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
-rw-r--r-- | package.json | 2 | ||||
-rw-r--r-- | ui/lib/icon-factory.js | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/package.json b/package.json index 9f47d76cb..9efba3866 100644 --- a/package.json +++ b/package.json @@ -62,11 +62,11 @@ "end-of-stream": "^1.1.0", "ensnare": "^1.0.0", "eth-bin-to-ops": "^1.0.1", + "eth-contract-metadata": "^1.0.0", "eth-hd-keyring": "^1.1.1", "eth-query": "^2.1.1", "eth-sig-util": "^1.1.1", "eth-simple-keyring": "^1.1.1", - "ethereum-contract-icons": "^1.0.0", "ethereumjs-tx": "^1.3.0", "ethereumjs-util": "ethereumjs/ethereumjs-util#ac5d0908536b447083ea422b435da27f26615de9", "ethereumjs-wallet": "^0.6.0", 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 |