mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Move to eth-contract-metadata
This commit is contained in:
parent
7268fcb694
commit
f06ad954b9
@ -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",
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user